Skip to content

Commit

Permalink
Fix small bugs in calculating correct relative URIs in chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
ndw committed Aug 19, 2023
1 parent 30762c2 commit ce8ad71
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 6 deletions.
4 changes: 2 additions & 2 deletions properties.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
ext {
xslTNGtitle = 'DocBook xslTNG'
xslTNGbaseName = 'docbook-xslTNG'
xslTNGversion = '2.1.8'
guideVersion = '2.1.8'
xslTNGversion = '2.1.9'
guideVersion = '2.1.9'
guidePrerelease = false

docbookVersion = '5.2CR5'
Expand Down
16 changes: 15 additions & 1 deletion src/guide/xml/changelog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ be of interest to users of the stylesheets. See the commits and pull requests on
<link xlink:href="https://github.com/docbook/xslTNG/">the repository</link> for
finer detail.</para>

<section xml:id="r219">
<info>
<title>Changes in version 2.1.9</title>
<productnumber>2.1.9</productnumber>
<date>2023-08-19</date>
</info>
<itemizedlist>
<listitem>
<para>Links added with <mode>m:head-additions</mode> were not being made relative
to the chunk base URI. Reworked <mode>m:html-body-script</mode> slightly so that
links there can also be made relative appropriately.</para>
</listitem>
</itemizedlist>
</section>

<section xml:id="r218">
<info>
<title>Changes in version 2.1.8</title>
Expand Down Expand Up @@ -60,7 +75,6 @@ finer detail.</para>
</listitem>
</itemizedlist>
</section>

<section xml:id="r217">
<info>
<title>Changes in version 2.1.7</title>
Expand Down
16 changes: 13 additions & 3 deletions src/main/xslt/modules/chunk-cleanup.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,10 @@
</xsl:if>

<xsl:sequence select="$scripts[not(@type) or contains(@type,'javascript')]"/>
<xsl:sequence select="$heads[position() gt 1]/node()"/>
<xsl:apply-templates select="$heads[position() gt 1]/node()">
<xsl:with-param name="rootbaseuri" select="$rbu"/>
<xsl:with-param name="chunkbaseuri" select="$cbu"/>
</xsl:apply-templates>
</head>
<body>
<xsl:variable name="class-list" as="xs:string*">
Expand Down Expand Up @@ -334,8 +337,15 @@
</nav>

<xsl:sequence select="$scripts[@type and not(contains(@type,'javascript'))]"/>

<xsl:apply-templates select="." mode="m:html-body-script">

<xsl:variable name="more-scripts" as="element()*">
<xsl:apply-templates select="." mode="m:html-body-script">
<xsl:with-param name="rootbaseuri" select="$rbu"/>
<xsl:with-param name="chunkbaseuri" select="$cbu"/>
</xsl:apply-templates>
</xsl:variable>

<xsl:apply-templates select="$more-scripts">
<xsl:with-param name="rootbaseuri" select="$rbu"/>
<xsl:with-param name="chunkbaseuri" select="$cbu"/>
</xsl:apply-templates>
Expand Down

0 comments on commit ce8ad71

Please sign in to comment.