Paragraph label breaks cross reference label in paragraph title

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Paragraph label breaks cross reference label in paragraph title

jtkorb
See Test Document below.

With the "[[figurelabel]]" as shown, asciidoctor -v generates a warning message
("asciidoctor: WARNING: invalid reference: OtherLabel") and the rendered
text for <<OtherLabel>> in the title is "[OtherLabel]".  If I remove the
"[[figurelabel]]" line, then no warning is generated and the text renders
(correctly) as "Other Item".  (In both case, the underlying link is correct.)

Am I doing something wrong, or is there a workaround for this problem?  I tried moving the label to
other places (e.g., at the end of the title), but nothing I found worked.

= Test Document

This text refers to <<OtherLabel>> as does the title text below.

[[figurelabel]]
.Explanation of something that refers to <<OtherLabel>>.
Just plain text.

[[OtherLabel, Other Item]]
Here is an other item.
Reply | Threaded
Open this post in threaded view
|

Re: Paragraph label breaks cross reference label in paragraph title

TheElderCat
I'm no expert and still learning about AsciidDoctor, but I suspect the problem lies in the order in which your refs appear.
I think maybe when the adoc is parsed, AsciiDoctor comes across your <<OtherLabel>> tag and expects the [[OtherLabel, Other Item]] tag to which it refers to appear next. But actually it comes across the [[figurelabel]] tag instead.

It works correctly, when you swap the order in which they appear.

= Test Document

== Original version

This text refers to <<OtherLabel>> as does the title text below.

[[figurelabel]]
.Explanation of something that refers to <<OtherLabel>>.
Just plain text.

[[OtherLabel, Other Item]]
Here is an other item.


== Order in which they appear is swapped

This text refers to <<OtherLabel>> as does the title text below.

[[OtherLabel, Other Item]]
Here is an other item.

[[figurelabel]]
.Explanation of something that refers to <<OtherLabel>>.
Just plain text.