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 @@
<xsl:output method="xhtml" omit-xml-declaration="yes" indent="no"/>
<xsl:param name="extraclass"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/">
<xsl:choose>
<xsl:when test="//body">
<div class="body {$extraclass}">
<xsl:apply-templates select="//style"/>
<xsl:copy-of select="//body/*"/>
<xsl:apply-templates/>
</div>
</xsl:when>
<xsl:otherwise>
......@@ -29,6 +34,10 @@
</xsl:choose>
</xsl:template>
<xsl:template match="html">
<xsl:apply-templates select="body/*"/>
</xsl:template>
<xsl:template match="style">
<xsl:copy>
<xsl:copy-of select="@*"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment