Skip to content

Commit

Permalink
IBX-284: Fixed line breaks inside links (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
Konrad Oboza authored Jun 15, 2021
1 parent 867267b commit 1015a6a
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@
</xsl:element>
</xsl:template>

<xsl:template match="docbook:link[@xlink:href]/text()">
<xsl:call-template name="breakLine">
<xsl:with-param name="text" select="."/>
</xsl:call-template>
</xsl:template>

<xsl:template match="docbook:link[@xlink:href]">
<xsl:element name="a" namespace="{$outputNamespace}">
<xsl:attribute name="href">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@
</xsl:element>
</xsl:template>

<xsl:template match="docbook:link[@xlink:href]/text()">
<xsl:call-template name="breakLine">
<xsl:with-param name="text" select="."/>
</xsl:call-template>
</xsl:template>

<xsl:template match="docbook:link[@xlink:href]">
<xsl:choose>
<xsl:when test="@xlink:href != '#'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,9 @@
</xsl:attribute>
</xsl:if>
<xsl:call-template name="ezattribute"/>
<xsl:apply-templates/>
<xsl:call-template name="breakline">
<xsl:with-param name="node" select="node()"/>
</xsl:call-template>
</link>
</xsl:template>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,17 @@
<link xlink:href="ezcontent://333" xlink:show="none" xml:id="id5" xlink:title="Content title" ezxhtml:class="linkClass5">Content name</link>
</para>
<para>
<link xlink:href="ezcontent://333" xlink:show="none" xml:id="id6" xlink:title="Content title" ezxhtml:class="linkClass5">
<link xlink:href="ezcontent://333" xlink:show="none" xml:id="id6" xlink:title="Content title" ezxhtml:class="linkClass6">
<ezattribute>
<ezvalue key="name-1">value 1</ezvalue>
<ezvalue key="name-2">value 2</ezvalue>
</ezattribute>
Content name
</link>
</ezattribute>Content name</link>
</para>
<para>
<literallayout class="normal">
<link xlink:href="ezcontent://444" xlink:show="none" xml:id="id7" xlink:title="Content title" ezxhtml:class="linkClass7">Content name
with some line break</link>
</literallayout>
</para>
<para><anchor xml:id="anchor"/>Some anchored content.</para>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
<a href="ezcontent://333" id="id5" title="Content title" class="linkClass5">Content name</a>
</p>
<p>
<a href="ezcontent://333" data-ezattribute-name-1="value 1" data-ezattribute-name-2="value 2" id="id6" title="Content title" class="linkClass5">
Content name
</a>
<a href="ezcontent://333" data-ezattribute-name-1="value 1" data-ezattribute-name-2="value 2" id="id6" title="Content title" class="linkClass6">Content name</a>
</p>
<p>
<a href="ezcontent://444" id="id7" title="Content title" class="linkClass7">Content name<br/>with some line break</a>
</p>
<p><a id="anchor"/>Some anchored content.</p>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
<a href="ezcontent://333" id="id5" title="Content title" class="linkClass5">Content name</a>
</p>
<p>
<a href="ezcontent://333" data-ezattribute-name-1="value 1" data-ezattribute-name-2="value 2" id="id6" title="Content title" class="linkClass5">
Content name
</a>
<a href="ezcontent://333" data-ezattribute-name-1="value 1" data-ezattribute-name-2="value 2" id="id6" title="Content title" class="linkClass6">Content name</a>
</p>
<p>
<a href="ezcontent://444" id="id7" title="Content title" class="linkClass7">Content name<br/>with some line break</a>
</p>
<p><a id="anchor"/>Some anchored content.</p>
</section>

0 comments on commit 1015a6a

Please # to comment.