1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-11 05:05:51 +01:00

Strip scripts from help pages.

This commit is contained in:
Kris Maglione
2011-08-19 15:42:07 -04:00
parent 4579a1fd16
commit f83c063798

View File

@@ -95,6 +95,7 @@
<xsl:template match="@*|node()" mode="overlay"> <xsl:template match="@*|node()" mode="overlay">
<xsl:apply-templates select="." mode="overlay-2"/> <xsl:apply-templates select="." mode="overlay-2"/>
</xsl:template> </xsl:template>
<xsl:template match="@*[starts-with(local-name(), 'on')]|*[local-name() = 'script']" mode="overlay-2"/>
<xsl:template match="@*|node()" mode="overlay-2"> <xsl:template match="@*|node()" mode="overlay-2">
<xsl:copy> <xsl:copy>
<xsl:apply-templates select="@*|node()" mode="overlay"/> <xsl:apply-templates select="@*|node()" mode="overlay"/>
@@ -232,7 +233,7 @@
<xsl:template match="dactyl:default[not(@type='plain')]" mode="help-2"> <xsl:template match="dactyl:default[not(@type='plain')]" mode="help-2">
<xsl:variable name="type" select="preceding-sibling::dactyl:type[1] | following-sibling::dactyl:type[1]"/> <xsl:variable name="type" select="preceding-sibling::dactyl:type[1] | following-sibling::dactyl:type[1]"/>
<span dactyl:highlight="HelpDefault"> <span dactyl:highlight="HelpDefault">
<xsl:copy-of select="@*"/> <xsl:copy-of select="@*[not(starts-with(local-name(), 'on'))]"/>
<xsl:text>(default: </xsl:text> <xsl:text>(default: </xsl:text>
<xsl:choose> <xsl:choose>
<xsl:when test="$type = 'string'"> <xsl:when test="$type = 'string'">
@@ -486,7 +487,7 @@
<xsl:when test="@op and @op != ''"><xsl:value-of select="@op"/></xsl:when> <xsl:when test="@op and @op != ''"><xsl:value-of select="@op"/></xsl:when>
<xsl:otherwise>=</xsl:otherwise> <xsl:otherwise>=</xsl:otherwise>
</xsl:choose> </xsl:choose>
<xsl:copy-of select="@*|node()"/> <xsl:copy-of select="@*[not(starts-with(local-name(), 'on'))]|node()[local-name() != 'script']"/>
</html:span> </html:span>
</xsl:variable> </xsl:variable>
<xsl:apply-templates select="exsl:node-set($nodes)" mode="help-1"/> <xsl:apply-templates select="exsl:node-set($nodes)" mode="help-1"/>
@@ -496,7 +497,7 @@
<xsl:variable name="nodes"> <xsl:variable name="nodes">
<code xmlns="&xmlns.dactyl;"> <code xmlns="&xmlns.dactyl;">
<se opt="{@opt}" op="{@op}" link="{@link}"> <se opt="{@opt}" op="{@op}" link="{@link}">
<xsl:copy-of select="@*|node()"/> <xsl:copy-of select="@*[not(starts-with(local-name(), 'on'))]|node()[local-name() != 'script']"/>
</se> </se>
</code> </code>
</xsl:variable> </xsl:variable>
@@ -605,6 +606,7 @@
<!-- Process Tree {{{1 --> <!-- Process Tree {{{1 -->
<xsl:template match="@*[starts-with(local-name(), 'on')]|*[local-name() = 'script']" mode="help-2"/>
<xsl:template match="@*|node()" mode="help-2"> <xsl:template match="@*|node()" mode="help-2">
<xsl:copy> <xsl:copy>
<xsl:apply-templates select="@*|node()" mode="help-1"/> <xsl:apply-templates select="@*|node()" mode="help-1"/>