Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@frerich
Copy link
Contributor

@frerich frerich commented May 11, 2022

<xref> elements can also be used to link to <figure> elements. Alas, the DocBook reader was not aware of this and thus generated a link text which just said 'figure_title'.

https://tdg.docbook.org/tdg/4.5/figure.html explains that <figure> elements can contain <title> elements, so let's try to use that if it is available.

Technically, this logic could be a lot more sophisticated. The docbook-xsl project's XSLT stylesheet for handling <xref> elements is a whopping 1300+ lines of code, and a lot of that is dedicated to a comprehensive heuristic which tries to come up with a sensible link text depending on the target element being referenced. However, it took seven years for someone to point out that Pandoc's handling of <xref> elements is incomplete, so maybe we don't need to go all the way just yet.

Closes #8064 .

<xref> elements can also be used to link to <figure> elements. Alas, the
DocBook reader was not aware of this and thus generated a link text
which just said 'figure_title'.

https://tdg.docbook.org/tdg/4.5/figure.html explains that <figure>
elements can contain <title> elements, so let's try to use that if it is
available.
@jgm
Copy link
Owner

jgm commented May 12, 2022

Thanks very much!

@jgm jgm merged commit b888a8c into jgm:master May 12, 2022
@frerich frerich deleted the fix_xref_reading branch May 12, 2022 06:01
@gxurma
Copy link

gxurma commented May 12, 2022

Whoa. Thanks! Funny. Am I since 7 years the only one trying to survive in corporate environment writing in asciidoctor(-pdf), where .docx is needed as standard documents and want to get there via docbook and pandoc?

@frerich
Copy link
Contributor Author

frerich commented May 12, 2022

Am I since 7 years the only one trying to survive in corporate environment writing in asciidoctor(-pdf), where .docx is needed as standard documents and want to get there via docbook and pandoc?

I don't know, maybe you are! :-) However, maybe you're also just the first person to exercise the <xref> element such that it points to <figure> elements.

@gxurma
Copy link

gxurma commented May 12, 2022

If you would be so kind and build a "nightly" windows version for me of this latest state, so I would be able to test it further. ;)

@jgm
Copy link
Owner

jgm commented May 12, 2022

Nightlies are built automatically. See the actions tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

xref usage with docx ends in "figure_title"

3 participants