Skip to content
Snippets Groups Projects
Commit a0e49676 authored by Thorsten Vitt's avatar Thorsten Vitt
Browse files

extractbody deals with nested HTMLs in a useful way.

Fixes #14397
parent 79c60692
No related branches found
No related tags found
No related merge requests found
...@@ -14,13 +14,18 @@ ...@@ -14,13 +14,18 @@
<xsl:output method="xhtml" omit-xml-declaration="yes" indent="no"/> <xsl:output method="xhtml" omit-xml-declaration="yes" indent="no"/>
<xsl:param name="extraclass"/> <xsl:param name="extraclass"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/"> <xsl:template match="/">
<xsl:choose> <xsl:choose>
<xsl:when test="//body"> <xsl:when test="//body">
<div class="body {$extraclass}"> <div class="body {$extraclass}">
<xsl:apply-templates select="//style"/> <xsl:apply-templates select="//style"/>
<xsl:copy-of select="//body/*"/> <xsl:apply-templates/>
</div> </div>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
...@@ -29,6 +34,10 @@ ...@@ -29,6 +34,10 @@
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<xsl:template match="html">
<xsl:apply-templates select="body/*"/>
</xsl:template>
<xsl:template match="style"> <xsl:template match="style">
<xsl:copy> <xsl:copy>
<xsl:copy-of select="@*"/> <xsl:copy-of select="@*"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment