Commit 8f570ad0 authored by Wendell Piez's avatar Wendell Piez

Excluding table//p from header promotion logic

parent fe6d1644
......@@ -71,7 +71,8 @@
<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:apply-templates select="//div[@class = 'docx-body']/p[matches(string(.),'\S')]" mode="digest"/>
<xsl:variable name="matching-ps" select="//div[@class = 'docx-body']/p[matches(string(.),'\S')] except //table//p"/>
<xsl:apply-templates select="$matching-ps" mode="digest"/>
<!-- Mode 'digest' is the initial (first) pass over the document, which boils down all paragraph-level
......@@ -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">[string-length(.) &lt;= 200][matches(.,'\S')][ancestor::*/@class='docx-body']</xsl:variable>
<xsl:variable name="extra-match-criteria">[empty(ancestor::table)][ancestor::*/@class='docx-body'][string-length(.) &lt;= 200][matches(.,'\S')]</xsl:variable>
<xsl:template match="body">
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