Skip to content

Commit

Permalink
Make sure text inside bridgehead is not hyphenated
Browse files Browse the repository at this point in the history
  • Loading branch information
egli committed Jan 6, 2023
1 parent d03a287 commit 14e1024
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test_xsl/hyphenation_test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,19 @@ y P
</utfx:assert-equal>
</utfx:test>

<utfx:test>
<utfx:name>Make sure bridgehead is not hyphenated</utfx:name>
<utfx:stylesheet-params>
<utfx:with-param name="contraction" select="2"/>
</utfx:stylesheet-params>
<utfx:assert-equal>
<utfx:source>
<dtb:bridgehead xml:lang="de">Ba­de­ho­sen­bun­des</dtb:bridgehead>
</utfx:source>
<utfx:expected>
y BRIDGE
BADEHOSCB/D%</utfx:expected>
</utfx:assert-equal>
</utfx:test>

</utfx:tests>
5 changes: 5 additions & 0 deletions xsl/dtbook2sbsform.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1370,8 +1370,13 @@
<!-- ========== -->

<xsl:template match="dtb:bridgehead">
<xsl:variable name="body"><xsl:apply-templates/></xsl:variable>
<xsl:call-template name="inline_macro">
<xsl:with-param name="macro" select="'BRIDGE'"/>
<xsl:with-param name="body">
<!-- Remove hypenation marks ('t','k', 'p' and 'w') -->
<xsl:value-of select="replace(string($body), '[tkpw]', '')"/>
</xsl:with-param>
</xsl:call-template>
</xsl:template>

Expand Down

0 comments on commit 14e1024

Please sign in to comment.