Skip to content

XHTMLImporterImpl.convert() can't handle converting custom data attributes for br tags to xhtml #101

@JamaicanFriedChicken

Description

@JamaicanFriedChicken

I have a data attribute that is appended in a <br> tag, for example <br data-suggestion="ef0oraskdmd">, when I am trying to convert it into a xhtml format, it gives me the below error:

ERROR org.docx4j.convert.in.xhtml.XHTMLImporterImpl - org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 55991; The element type "br" must be terminated by the matching end-tag "</br>"."

When I remove the data attribute data-*, XHTMLImporterImpl is able to convert it to a xhtml format. How can I mitigate this issue? Is there any temporary fix I can implement?

docx4j-ImportXHTML - 11.4.6
Java 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions