Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support xrefstyle on link; fix #561 #562

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/guide/xml/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ the combination of options. See <xref linkend="verbatim-environments"/>.</para>
the <tag class="attribute">xml:id</tag> value of a chunk will be used as the
chunk filename.</para>
</listitem>
<listitem>
<para>Support <tag class="attribute">xrefstyle</tag> on <tag>link</tag>;
fixed <link xlink:href="https://github.com/docbook/xslTNG/issues/561">#561</link>.</para>
</listitem>
</itemizedlist>
</section>

Expand Down
2 changes: 1 addition & 1 deletion src/main/xslt/modules/links.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
</xsl:template>

<xsl:function name="fp:localization-template-from-xrefstyle" as="element(l:template)">
<xsl:param name="xref" as="element(db:xref)"/>
<xsl:param name="xref" as="element()"/>
<xsl:param name="target" as="element()"/>

<xsl:variable name="content" as="item()*">
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/expected/link.006.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" class="no-js"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/><script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script><title>Unit test: link.006</title><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link href="https://purl.org/dc/elements/1.1/" rel="schema.dc"/><meta content="2011-04-22T17:02:00-06:00" name="dc.modified"/><meta content="DocBook xslTNG" name="generator"/><link href="./css/docbook.css" rel="stylesheet" media="screen"/></head><body class="home"><nav class="top"></nav><main><article id="article" class="article component"><header><h1>Unit test: link.006</h1></header><p>Test: <a href="#article" class="xref xref-article">xrefstyle: Unit test: link.006</a>.</p><p>Test: <a href="#article" class="xref xref-article">Unit test: link.006</a>.</p><p>Test: <a href="#article" class="xref xref-article">xrefstyle: Unit test: link.006</a>.</p><p>Test: <a href="#article" class="link">link text</a>.</p></article></main><nav class="bottom"></nav></body></html>
14 changes: 14 additions & 0 deletions src/test/resources/xml/link.006.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<article xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
version="5.0" xml:id="article">
<title>Unit test: link.006</title>

<para>Test: <xref xrefstyle="xrefstyle: %c" linkend="article"/>.</para>

<para>Test: <link linkend="article"/>.</para>

<para>Test: <link xrefstyle="xrefstyle: %c" linkend="article"/>.</para>

<para>Test: <link xrefstyle="xrefstyle: %c" linkend="article">link text</link>.</para>

</article>