Unplanned
Last Updated: 18 Mar 2019 09:54 by ADMIN
Brian Stanek
Created on: 18 Mar 2019 09:51
Category: WordsProcessing
Type: Bug Report
0
WordsProcessing: List before a table is inserted in the first cell of the table while exporting to HTML
When a list is just before the table, all of its list items are inserted in the first cell of the table while exporting to HTML.

Workaround: Add a paragraph between the list and the table
foreach (var section in this.document.Sections)
{
    bool shouldInsert = false;
  
    foreach (var block in section.Blocks.ToList())
    {
        var paragraph = block as Paragraph;
        if (paragraph != null && paragraph.ListId > -1)
        {
            shouldInsert = true;
        }
        else if (shouldInsert)
        {
            var paragraphToInsert = new Paragraph(this.document);
            paragraphToInsert.Spacing.LineSpacing = 1;
            paragraphToInsert.Spacing.LineSpacingType = HeightType.Exact;
            paragraphToInsert.Spacing.SpacingAfter = 0;
            block.BlockContainer.Blocks.Insert(section.Blocks.IndexOf(block), paragraphToInsert);
            shouldInsert = false;
        }
    }
}
0 comments