Commit 1d2c2d96 authored by Alex Theg's avatar Alex Theg
Browse files

make img select pattern more robust

parent bcc67741
......@@ -49,7 +49,7 @@
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<!-- We only permit a header to be propagated if it has (non-ws) contents. -->
<xsl:template match="h1| h2 | h3 | h4 | h5 | h6">
<xsl:if test="matches(.,'\S')">
......@@ -64,9 +64,9 @@
<!-- Empty line feeds may be left especially after paragraph splitting in an earlier step. -->
<xsl:template match="p[not(matches(.,'[^&#xA0;\s]'))]">
<!-- but do save any image tags -->
<xsl:apply-templates select="*/img" mode="copy-after-all"/>
<xsl:apply-templates select=".//img" mode="copy-after-all"/>
</xsl:template>
<!-- NB stripping b and strong for now. -->
<!-- Also dropping inline markup that has only whitespace /tabs -->
<xsl:template match="i | sup | sub | a | code | em">
......@@ -75,17 +75,17 @@
<!-- Special adjustments for Editoria -->
<xsl:template priority="10" match="sup[empty(node() except note)]">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="span[@class=('footnoteRef','endnoteRef')]"/>
<!-- BUT - special handling for internal-to-Word bookmarks (as produced by XSweet) -
these are always empty and we don't want their (comment) content either. -->
<xsl:template match="a[starts-with(@id,'docx-bookmark')] | a[starts-with(@href,'#docx-bookmark')]"/>
<xsl:template match="a[starts-with(@id,'docx-bookmark')] | a[starts-with(@href,'#docx-bookmark')]"/>
<xsl:template match="note | note/@*">
<xsl:apply-templates select="." mode="copy-after-all"/>
</xsl:template>
......@@ -112,6 +112,6 @@
<!-- Bye-bye @class, bye-bye @style! -->
<xsl:template match="@class | @style" priority="2"/>
</xsl:stylesheet>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment