java-mammoth
java-mammoth copied to clipboard
Cross-references are not converted in anchors
Hi, Some cross-references are not converted in anchors. I attached a sample: sample.docx
The result of the conversion should be:
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title/>
</head>
<body>
<h1>Title</h1>
<p>Reference to: <a href="#_Ref66182243">Heading</a></p>
<h1><a id="_Ref66182243"/>Heading</h1>
<p>Content1</p>
</body>
</html>
but the "a" element with the "href" attribute is not added.
This kind of references have the "REF" field definition with the "\h" argument: https://c-rex.net/projects/samples/ooxml/e1/Part4/OOXML_P4_DOCX_REFREF_topic_ID0ESRL1.html
This can be a possible fix: https://github.com/DunaMariusCosmin/java-mammoth/commit/0e23540daedbb0d7c4295b575f891a30e4142f4b
Best regards, Cosmin