asciidoctor / asciidoctor-latex

:triangular_ruler: Add LaTeX features to AsciiDoc & convert AsciiDoc to LaTeX
http://asciidoctor.org
Other
114 stars 26 forks source link

[BUG] Respect custom link text for internal references #64

Closed tribut closed 7 years ago

tribut commented 7 years ago

This fixes a bug that would simply discard custom link texts, for example in

the <<myref,problem>> is hard

the linked text would not be "problem" but whatever myref points to.

mojavelinux commented 7 years ago

Could you add a doctest?

tribut commented 7 years ago

Well, that was harder than expected. Doctests against the default examples were not possible (and broken, when added) and the link generation logic had several flaws as revealed when the tests finally did work.

jirutka commented 7 years ago

Doctests against the default examples were not possible (and broken, when added)

What do you mean with not possible?

tribut commented 7 years ago

See https://github.com/asciidoctor/asciidoctor-latex/pull/64/commits/991016a284d4c94c8e3f747ba5ffdd66db02a3de The default paths were not included and the xpath expression ./p/node() did not match anything, because the results are wrapped in <div class="paragraph"></div>.