docxintellij-pluginasciidoc

I am getting `Error creating DOCX from AsciiDoc file` in IntelliJ Idea, How can this be resolved?


I am getting below error in IntelliJ Idea while trying to convert my .adoc file to docx using Official AsciiDoc Plugin. However, converting to pdf is working fine.

Error creating DOCX from AsciiDoc file

/ Invalid XML: 177:100 (6599)-177:110 (6609): Expected end element for: Name {nameLocalName = "emphasis", nameNamespace = Just "http://docbook.org/ns/docbook", namePrefix = Nothing}, but received: EventEndElement (Name {nameLocalName = "literal", nameNamespace = Just "http://docbook.org/ns/docbook", namePrefix = Nothing})

I am not able to find any resource to help solve this problem.

I have searched the internet, official docs, and plugin official docs, but did not find anything useful.


Solution

  • Based on the error message, which tells you there is invalid XML, it seems like the problem exists where you have emphasis (italics) beside an inline literal.

    Search your document for an underscore immediately before or after a backtick. If you find that combination, try removing the formatting to see if the conversion succeeds. If you have more than one instance, remove that formatting until the conversion succeeds.

    You likely have to use the divide-and-conquer approach if you don't have that markup combination. Remove the second half of the page content. If the conversion succeeds, you know the problem is in the second half. Otherwise, the problem is in the first half. Undo the content removal. Remove half the portion where the problem is and try the conversion again. Continue narrowing down the portion of the document until you have only a few lines left, and you should be able to see the problematic markup.

    At this point, you've identified where the problem exists. What to do about it depends on the markup you used and what is an acceptable solution.