Open gangz opened 5 years ago
I written a test to reproduce the issue like following:
@Test public void testHangingIndent() throws Docx4JException, JAXBException {
String xhtml= "<p style=\"margin-left:2em;"
+ "text-indent:-2em;\">"
+ "text</p>";
wordMLPackage.getMainDocumentPart().getContent().addAll(
convert(xhtml));
List<Object> matches = wordMLPackage.getMainDocumentPart().getJAXBNodesViaXPath("//w:pPr", false);
PPr ppr = (PPr) matches.get(0);
assertEquals(ppr.getInd().getLeft().intValue(),480);
assertEquals(ppr.getInd().getHanging().intValue(),480);
}
I tried to fix the problem, and finally it was fixed in
But I do not sure whether the modification fits on the design principle of docx4j , so I have not create a PR, just add comments here for information purpose.
Thanks for the great work of docx4j
Thanks for this. You are correct; text-indent is not supports (but margin-left is). So hanging indents don't work.
I encountered a HTML file which contains text-indent style like following:
Currently docx4j-ImportXHTML still does not support it yet.