Language traits unique_id() already includes a workaround for '__' pairs in IDs misinterpreted as AsciiDoc "unconstrained quotes". The same issue makes references in description text generate invalid hyperlinks.
The hack below "solves" the issue for me. A better fix would probably factor out sanitation of any ID text though.
diff --git a/asciidoxy/parser/doxygen/description_parser.py b/asciidoxy/parser/doxygen/description_parser.py
index ee13e5f..671f492 100644
--- a/asciidoxy/parser/doxygen/description_parser.py
+++ b/asciidoxy/parser/doxygen/description_parser.py
@@ -925,7 +925,9 @@ class Ref(NestedDescriptionElement):
def __init__(self, language_tag: str, refid: str, kindref: str, *contents: DescriptionElement):
super().__init__(language_tag, *contents)
- self.refid = refid
+ # Workaround a bug in asciidoctor: if there is an occurrence of __ the ref is not parsed
+ # correctly: #2746
+ self.refid = refid.replace("__", "-")
self.kindref = kindref
def to_asciidoc(self, context: AsciiDocContext = None) -> str:
Language traits
unique_id()
already includes a workaround for '__' pairs in IDs misinterpreted as AsciiDoc "unconstrained quotes". The same issue makes references in description text generate invalid hyperlinks.The hack below "solves" the issue for me. A better fix would probably factor out sanitation of any ID text though.