Using AsciiDoctor to generate HTML and PDF. I have anchors defined by putting square brackets around them like so: [[cross-ref]]
I then link to that anchor like this: <<cross-ref>>
Problem - when I generate the HTML and PDF, the link is displayed like this (as a blue link): [cross-ref]
I looked at the HTML, and the square brackets are part of the text, so it's not a CSS thing.
How can I remove the square brackets from the rendered cross reference link?
The shorthand syntax of [[cross-ref]]
and <<cross-ref>>
is intended to link section titles to other parts of the document.
So the text of the link becomes the same as the title of the section where the anchor was placed.
For example
[[cross-ref]]
=== My Section
Link to <<cross-ref>>.
Will be rendered something like Link to My Section.
Where the anchor is placed on something other than a section header (e.g. paragraph) the bracketed anchor name is displayed instead as a placeholder.
You can always provide replacement text to the link by using the extended format:
<<cross-ref,my alternative text>>