Skip to content

Commit

Permalink
another hack for tidying html input, fixes #109
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstadler committed Aug 19, 2022
1 parent 4e1decf commit 1d51f50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion filter/xsl/filter_put.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
<xsl:template name="replace_nodes">
<xsl:param name="text"/>
<!-- Wrap contents in a temporary <div> root element and parse XML -->
<xsl:variable name="fragment">&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;<xsl:value-of select="replace(replace($text, '&amp;(\s)', '&amp;amp;$1'), '&amp;nbsp;', '&#xa0;')"/>&lt;/div&gt;</xsl:variable>
<xsl:variable name="fragment">&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;<xsl:value-of select="replace(replace(replace($text, '&amp;(\s)', '&amp;amp;$1'), '&amp;nbsp;', ' '), '&lt;br&gt;', '&lt;br/&gt;')"/>&lt;/div&gt;</xsl:variable>
<xsl:for-each select="parse-xml($fragment)/h:div">
<xsl:apply-templates/>
</xsl:for-each>
Expand Down

0 comments on commit 1d51f50

Please sign in to comment.