Conversion of content in tags

Home Forums Open-Xml-PowerTools Conversion of content in tags

This topic contains 1 reply, has 2 voices, and was last updated by  Eric White 8 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3747

    gamartin
    Participant

    I posted this on github 2 weeks ago but am getting no responses there.

    When converting content in <dl><dd> tags the HTML converter appears to be adding a lot of extra linefeeds to the content of the elements. For example the following HTML :

     <dt>g. <strong>'double time'</strong></dt>
     <dd>means twice (2) the straight-time hourly rate (<span lang='fr'>tarif double</span>),</dd> 

    will get generated into WML like this:

    g.
    ‘double time’
    means twice (2) the straight-time hourly rate (
    tarif double
    ),

    and

     <dt>a. <strong>'bargaining unit'</strong></dt>
     <dd>means all the employees of the Employer in the Computer Systems Group, as described in the certificate issued by the former Public Service Staff Relations Board on the <time datetime='1969-03-11'>eleventh (11<sup>th</sup>) day of March 1969</time>, and as amended on <time datetime='1977-12-13'>December 13, 1977</time> and <time datetime='1999-06-01'>June 1, 1999</time> (<span lang='fr'>unité de négociation</span>),</dd> 

    will be generated as:

    a.
    ‘bargaining unit’
    means all the employees of the Employer in the Computer Systems Group, as described in the certificate issued by the former Public Service Staff Relations Board on the
    eleventh (11
    th
    ) day of March 1969
    , and as amended on
    December 13, 1977
    and
    June 1, 1999
    (
    unité de négociation
    ),

    I have also discovered that a element inside of a <dd> element will cause the WML to be corrupt and the file cannot be opened. Example below:

    <dt>h. <strong>'employee'</strong></dt>
     <dd>means a person so defined by the <em>Public Service Labour Relations Act</em> and who is a member of the bargaining unit (<span lang='fr'>employé</span>),</dd> 

    Any help would be appreciated

    Thanks.

    #3764

    Eric White
    Keymaster

    The HtmlToWmlConverter was not designed to support definition lists. This is not a feature of the module.

    I recommend removing those tags from the source HTML before invoking the HtmlToWmlConvert module.

    The HtmlAgilityPack is a good API for doing this type of stuff.

    https://htmlagilitypack.codeplex.com/

    Cheers, Eric

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.