Unplanned
Last Updated: 11 Mar 2020 17:27 by ADMIN
SWAT
Created on: 11 Mar 2020 17:08
Category: WordsProcessing
Type: Bug Report
0
WordsProcessiong: HtmlFormatProvider: When <div> elements contain non-inline HTML elements, they and their styles are removed on import

When <div> elements contain non-inline HTML elements, they and their styles are removed on import.

Input:

<div style="margin-left: 200px;">
      <ol>
            <li>Item 1</li>
            <li>Item 2</li>                  
      </ol>
</div>

Output:

<ol style="list-style-type: decimal;">
         <li value="1"><span>Item 1</span></li>
         <li value="2"><span>Item 2</span></li>
</ol>
On import, any <div> elements are converted to paragraphs (<p>). However, paragraphs cannot contain non-inline elements (in this case <ol>), which is why the <div>, which is now converted to <p> is removed along with all its properties.

 

Workaround: Set the style properties to the inner elements. They will not disappear.

0 comments