Skip to content

Commit

Permalink
Handle punctuation in line labels.
Browse files Browse the repository at this point in the history
  • Loading branch information
hcayless committed Jul 14, 2023
1 parent dbc36c3 commit a2eabc4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pn-xslt/MakeHTML.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@
<xsl:apply-templates select="$result" mode="app-flatten"/>
</xsl:template>

<xsl:template match="t:hi|t:g|t:lb[@break='no']|t:add|t:del|t:subst" mode="app-flatten">🐯<xsl:value-of select="local-name(.)"/>🐯<xsl:for-each select="@*"><xsl:value-of select="name(.)"/>="<xsl:value-of select="."/>"🐯</xsl:for-each><xsl:apply-templates mode="app-flatten"/>🐹<xsl:value-of select="local-name(.)"/>🐹</xsl:template>
<xsl:template match="t:hi|t:g|t:lb[@break='no']|t:add|t:del|t:subst" mode="app-flatten">🐯<xsl:value-of select="local-name(.)"/>🐯<xsl:for-each select="@*"><xsl:value-of select="name(.)"/>="<xsl:value-of select="translate(.,',.','🦋🐌')"/>"🐯</xsl:for-each><xsl:apply-templates mode="app-flatten"/>🐹<xsl:value-of select="local-name(.)"/>🐹</xsl:template>

<xsl:template match="text()" mode="app-tokenize">
<xsl:analyze-string select="." regex="([ \n\r\t,.;;··])+">
Expand All @@ -823,8 +823,9 @@
</xsl:template>

<xsl:template match="text()" mode="app-restore">
<xsl:variable name="restore" select="translate(.,'🦋🐌',',.')"/>
<xsl:variable name="pass1">
<xsl:analyze-string select="." regex="🐯([^🐯]+)🐯(([^🐯]+=&quot;[^&quot;]+&quot;🐯)*)([^🐯]*)">
<xsl:analyze-string select="$restore" regex="🐯([^🐯]+)🐯(([^🐯]+=&quot;[^&quot;]+&quot;🐯)*)([^🐯]*)">
<xsl:matching-substring>
<xsl:element namespace="http://www.tei-c.org/ns/1.0" name="{regex-group(1)}">
<xsl:attribute name="x">open</xsl:attribute>
Expand Down

0 comments on commit a2eabc4

Please sign in to comment.