- Rewrite text wrapping for HTML line numbering so that empty lines
are not lost Reported by: wblock
This commit is contained in:
parent
e697cff368
commit
53daba29a0
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=44133
1 changed files with 21 additions and 3 deletions
|
@ -298,9 +298,27 @@
|
|||
<xsl:template name="wrap.text">
|
||||
<xsl:param name="content"/>
|
||||
|
||||
<xsl:for-each select="str:tokenize($content, '
')">
|
||||
<span class="verbatim"><xsl:value-of select="."/>
</span>
|
||||
</xsl:for-each>
|
||||
<xsl:choose>
|
||||
<xsl:when test="starts-with($content, '
')">
|
||||
<span class="verbatim">​</span>
|
||||
|
||||
<xsl:call-template name="wrap.text">
|
||||
<xsl:with-param name="content" select="substring-after($content, '
')"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:when test="contains($content, '
')">
|
||||
<span class="verbatim"><xsl:value-of select="substring-before($content, '
')"/>
</span>
|
||||
|
||||
<xsl:call-template name="wrap.text">
|
||||
<xsl:with-param name="content" select="substring-after($content, '
')"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
|
||||
<xsl:otherwise>
|
||||
<span class="verbatim"><xsl:value-of select="$content"/>
</span>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<!-- XXX: breaks line numbering and syntax highlighting that we do not use
|
||||
|
|
Loading…
Reference in a new issue