Anchors in AsciiDoc don't work correctly
Let's assume that we have the following over-simplified code in test.adoc
:
== Table of Figures
xref:Toc314[Figure 3.1‑4: My diagram]
== Figure 3.1‑4: My diagram[[Toc314]]
If this file gets processed by AsciiDoctor, one ends up with a working link (note the part saying <a id="Toc314"></a>
):
<div class="sect1">
<h2 id="_table_of_figures">Table of Figures</h2>
<div class="sectionbody">
<div class="paragraph">
<p><a href="#Toc314">Figure 3.1‑4: My diagram</a></p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="_figure_3_1_4_my_diagram_a_id_toc314_a">Figure 3.1‑4: My diagram<a id="Toc314"></a></h2>
<div class="sectionbody">
</div>
</div>
However when GitLab renders the same, this is the result (note the empty <a></a>
without id
after My diagram
):
<div class="file-content md">
<div>
<h2 id="user-content-table-of-figures">
<a class="anchor" href="#user-content-table-of-figures"></a>Table of Figures</h2>
<div>
<div>
<p><a href="#Toc314">Figure 3.1‑4: My diagram</a></p>
</div>
</div>
</div>
<div>
<h2 id="user-content-figure-3-14-my-diagram">
<a class="anchor" href="#user-content-figure-3-14-my-diagram"></a>Figure 3.1‑4: My diagram<a></a>
</h2>
<div>
</div>
</div>
</div>
Almost everything else related to AsciiDoc works perfectly (thanks a lot to everyone involved in the huge effort to make it work out of the box), and I hope that #228885 also gets implemented soon, but this one is a pretty big blocker that hinders browsability of documentation.
Edited by Mojca Miklavec