Commit 16779e2f authored by Alex Theg's avatar Alex Theg

update regex, tighten is-list logic

parent 66ad9d11
......@@ -31,8 +31,9 @@ In this stylesheet it is used for everything except that div, which wraps the se
Unmarked list detection doesn't consider list level: `<xsw:list>`s get @level 0, although list item retains its `data-xsweet-list-level` attribute
Grouping key is true() for nominal list items, false if not.-->
<xsl:template name="detect-lists">
<xsl:for-each-group select="*" group-adjacent="xsw:is-list(.)=true()">
<xsl:for-each-group select="*" group-adjacent="xsw:is-list(.)">
<xsl:choose>
<!--lists must have at least 2 adjacent <p>s that look like list items-->
<xsl:when test="current-grouping-key() and count(current-group()) gt 1">
<xsl:call-template name="tag-lists"/>
</xsl:when>
......@@ -51,9 +52,8 @@ In this stylesheet it is used for everything except that div, which wraps the se
<xsl:function name="xsw:is-list" as="xs:boolean?">
<xsl:param name="whose" as="element()"/>
<!--list detected if paragraph matches: any amt of ws at start (inc tabs), digits + a period + at least one more spaces-->
<xsl:variable name="list-assignment" select="matches($whose,'^\s?\t?\d+\.\s?')"/>
<xsl:sequence select="xs:boolean($list-assignment)"/>
<!--list detected if paragraph matches: any amt of ws at start + digits + a period + at least one space-->
<xsl:sequence select="matches($whose,'^\s*\d+\.\s')"/>
</xsl:function>
</xsl:stylesheet>
</xsl:stylesheet>
\ No newline at end of file
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