Hi,
I have a Word document with document bullets in it. When converting the DOCX to HTML the document bullets are saved as paragraphs (<p>
) instead of unordered list elements (<ul>
).
Here is the document Bullets.zip (10.8 KB)
The failing test:
@Test
public void testBullets() throws Exception {
File docxFile = new File("src/test/resources/Bullets.docx");
InputStream in = new FileInputStream(docxFile);
Document doc = new Document(in);
NodeCollection paragraphs = doc.getChildNodes(NodeType.PARAGRAPH, true);
assertThat(paragraphs.get(2).toString(SaveFormat.HTML), Matchers.containsString("<ul>"));
}
The output of paragraphs.get(2).toString(SaveFormat.HTML)
is:
<p style="margin-top:0pt; margin-left:54pt; margin-bottom:0pt; text-indent:-36pt; font-size:10pt">
<span style="font-family:Arial">•</span>
<span style="font:7pt 'Times New Roman'">                      </span>
<span style="font-family:Arial">Option 1</span>
</p>
Could you please help?
Thank you,
Mihail