</otherwise>
</choose>
</template>
+ <template name="LesML:comment-out">
+ <param name="source"/>
+ <variable name="comment-split-fragment">
+ <call-template name="LesML:split">
+ <with-param name="source" select="$source"/>
+ <with-param name="separator" select="'--'"/>
+ </call-template>
+ </variable>
+ <comment>
+ <for-each select="exsl:node-set($comment-split-fragment)/*">
+ <if test="string()='' or starts-with(., '‐')">
+ <text>͏</text>
+ </if>
+ <value-of select="."/>
+ <if test="substring(., string-length(.), 1)='‐'">
+ <text>͏</text>
+ </if>
+ <choose>
+ <when test="position()!=last()">
+ <text>-͏-</text>
+ </when>
+ </choose>
+ </for-each>
+ </comment>
+ </template>
<template name="LesML:id-and-contents">
<param name="source"/>
<variable name="id-and-lang">
<variable name="docsep" select="$noshebang[starts-with(., '#!lesml') or starts-with(., '##')][1]"/>
<variable name="doclines" select="exslset:leading($noshebang, $docsep)"/>
<if test="starts-with($first-line, '##') and $first-line!='##'">
- <comment>
- <value-of select="substring-after($first-line, '##')"/>
- </comment>
+ <call-template name="LesML:comment-out">
+ <with-param name="source" select="substring-after($first-line, '##')"/>
+ </call-template>
</if>
<if test="$doclines[normalize-space()!='']">
<variable name="record-separators" select="$doclines[starts-with(., '%%')]"/>
</element>
</if>
<if test=".!='%%'">
- <comment>
- <value-of select="substring-after(., '%%')"/>
- </comment>
+ <call-template name="LesML:comment-out">
+ <with-param name="source" select="substring-after(., '%%')"/>
+ </call-template>
</if>
</for-each>
</element>
</element>
</when>
<when test="starts-with($text, '#') and &sigiled-text;">
- <comment>
- <value-of select="&unsigiled-text;"/>
- </comment>
+ <call-template name="LesML:comment-out">
+ <with-param name="source" select="&unsigiled-text;"/>
+ </call-template>
</when>
<otherwise>
<element name="p" namespace="&xhtml;">
</for-each>
<value-of select="substring-before($end-node, '⌫')"/>
</variable>
- <variable name="comment-split-fragment">
- <call-template name="LesML:split">
- <with-param name="source" select="string($comment)"/>
- <with-param name="separator" select="'--'"/>
- </call-template>
- </variable>
<variable name="rest-fragment">
<element name="span" namespace="&xhtml;">
<value-of select="substring-after($end-node, '⌫')"/>
<copy-of select="@*"/>
<copy-of select="$start-node/preceding-sibling::node()"/>
<copy-of select="substring-before($start-node, '⌦')"/>
- <comment>
- <for-each select="exsl:node-set($comment-split-fragment)/*">
- <if test="string()='' or starts-with(., '‐')">
- <text>͏</text>
- </if>
- <value-of select="."/>
- <if test="substring(., string-length(.), 1)='‐'">
- <text>͏</text>
- </if>
- <choose>
- <when test="position()!=last()">
- <text>-͏-</text>
- </when>
- </choose>
- </for-each>
- </comment>
+ <call-template name="LesML:comment-out">
+ <with-param name="source" select="string($comment)"/>
+ </call-template>
<copy-of select="exsl:node-set($commented-rest-fragment)/*/node()"/>
</copy>
</when>
<for-each select="exsl:node-set($split-fragment)/node()">
<value-of select="."/>
<if test="position()!=last()">
- <comment>
- <text>͏</text>
- </comment>
+ <call-template name="LesML:comment-out"/>
</if>
</for-each>
</when>