Commit a764dab8 authored by Wendell Piez's avatar Wendell Piez

Repairing ns glitch in list promotion; protecting list item contents from header promotion

parent b34b0fc6
......@@ -71,7 +71,7 @@
<xsl:variable name="p-proxies">
<!-- Only paragraphs with contents are examined for header promotion.
matches(string(.),'\S') is true iff non-ws content is present. -->
<xsl:variable name="matching-ps" select="//div[@class = 'docx-body']/p[matches(string(.),'\S')] except (//table//p | //list//p)"/>
<xsl:variable name="matching-ps" select="//div[@class = 'docx-body']/p[matches(string(.),'\S')] except (//table//p | //li//p)"/>
<xsl:apply-templates select="$matching-ps" mode="digest"/>
</xsl:variable>
......
......@@ -29,7 +29,7 @@
<!-- Note that generated stylesheet will error if $extra-match-criteria is anything but an XPath filter expression
i.e. '[ booleanExp ]' (with square brackets).
Exposing it as a parameter isn't recommended unless we can defend against arbitrary XPath injection. -->
<xsl:variable name="extra-match-criteria">[empty(ancestor::table|ancestor::list)][ancestor::*/@class='docx-body'][string-length(.) &lt;= 200][matches(.,'\S')]</xsl:variable>
<xsl:variable name="extra-match-criteria">[empty(ancestor::table|ancestor::li)][ancestor::*/@class='docx-body'][string-length(.) &lt;= 200][matches(.,'\S')]</xsl:variable>
<xsl:template match="body">
......
......@@ -3,6 +3,7 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsw="http://coko.foundation/xsweet"
xmlns="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="#all">
<xsl:output method="xml" indent="no" omit-xml-declaration="yes"/>
......
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