You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, input the following AsciiDoc which uses the shorthand ID syntax:
.. [#s2a3]#*Term* . The term of this Public License is specified in
Section link:#s6a[6(a)] .#
This will generate the following DocBook:
<simpara><anchorxml:id="s2a3"xreflabel="Term . The term of this Public License is specified inSection <link xl:href="#s6a">6(a)</link> ."/><emphasisrole="strong">Term</emphasis> . The term of this Public License is specified in
Section <linkxl:href="#s6a">6(a)</link> .</simpara>
I think this is invalid XML because it includes unescaped characters such as < and " in the attribute value, as shown below:
xreflabel="Term . The term of this Public License is specified in
Section <linkxl:href="#s6a">6(a)</link> ."
I initially thought this is a bug in Pandoc, but according to jgm/pandoc#10503 (comment), it may be a bug in Asciidoctor's DocBook backend. Even if we need to use the inline anchor syntax instead of the shorthand ID syntax when including links and cross references, I think it should at least output valid XML.
The text was updated successfully, but these errors were encountered:
sorairolake
changed the title
DocBook is generated which includes unescaped < and " in the attribute value
DocBook is generated which includes unescaped characters such as < and " in the attribute value
Jan 8, 2025
The issue here is that the way the anchor is being defined, it includes formatted text in the xreflabel. This is not a supported use case for AsciiDoc.
The correct way to write this would be as follows:
[[s2a3,Term]]*Term*. The term of this Public License is specified in Section <<s6a,6(a)>>.
In other words, you can use the [[id,reftext]] syntax to define a valid xreflabel (i.e., the reftext) for the reference.
We may need to discuss in the AsciiDoc Language project what happens when the reftext includes formatted text. If the language project decides that text needs to be normalized, then it's something Asciidoctor would have to implement. As for now, it's not something that will be changed in Asciidoctor.
See jgm/pandoc#10503.
First, input the following AsciiDoc which uses the shorthand ID syntax:
This will generate the following DocBook:
I think this is invalid XML because it includes unescaped characters such as
<
and"
in the attribute value, as shown below:I initially thought this is a bug in Pandoc, but according to jgm/pandoc#10503 (comment), it may be a bug in Asciidoctor's DocBook backend. Even if we need to use the inline anchor syntax instead of the shorthand ID syntax when including links and cross references, I think it should at least output valid XML.
The text was updated successfully, but these errors were encountered: