3 SPDX-FileCopyrightText: 2024 Lady <https://www.ladys.computer/about/#lady>
4 SPDX-License-Identifier: MPL-2.0
7 ⁌ 💄📝 Les·M·L ∷ parser.xslt
9 © 2024 Lady [@ Lady’s Computer]
11 This Source Code Form is subject to the terms of the Mozilla Public License, v 2.0.
12 If a copy of the M·P·L was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
15 <!ENTITY section-break "*-.=_~·․‥…⁂⋯─━┄┅┈┉╌╍═╴╶╸╺☙❧ ・*-.=_~">
16 <!ENTITY sigiled-text "(string-length($text)=1 or substring($text, 2, 1)=' ')">
17 <!ENTITY unsigiled-text "substring($text, 3, string-length($text)-2)">
20 xmlns="http://www.w3.org/1999/XSL/Transform"
21 xmlns:LesML="urn:fdc:ladys.computer:20240512:LesML"
22 xmlns:exsl="http://exslt.org/common"
23 xmlns:exslstr="http://exslt.org/strings"
24 xmlns:html="http://www.w3.org/1999/xhtml"
25 xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
26 exclude-result-prefixes="LesML"
27 extension-element-prefixes="exsl exslstr"
30 <书社:id>urn:fdc:ladys.computer:20240512:LesML:parser.xslt</书社:id>
31 <template name="LesML:split">
32 <param name="source"/>
33 <param name="separator" select="'
'"/>
35 <when test="contains($source, $separator)">
37 <value-of select="substring-before($source, $separator)"/>
39 <call-template name="LesML:split">
40 <with-param name="source" select="substring-after($source, $separator)"/>
41 <with-param name="separator" select="$separator"/>
46 <value-of select="$source"/>
51 <template name="LesML:break-and-unescape">
52 <param name="source"/>
53 <variable name="broken-fragment">
54 <call-template name="LesML:split">
55 <with-param name="source" select="$source"/>
56 <with-param name="separator" select="'
'"/>
59 <variable name="broken" select="exsl:node-set($broken-fragment)/node()"/>
60 <for-each select="$broken">
61 <call-template name="LesML:unescape">
62 <with-param name="source" select="string()"/>
64 <if test="position()!=count($broken)">
69 <template name="LesML:unescape">
70 <param name="source"/>
72 <when test="contains($source, '<U+')">
73 <variable name="after" select="substring-after($source, '<U+')"/>
75 <when test="contains($after, '>')">
76 <variable name="inner" select="substring-before($after, '>')"/>
77 <variable name="components">
78 <call-template name="LesML:split">
79 <with-param name="source" select="$inner"/>
80 <with-param name="separator" select="'.'"/>
83 <variable name="component-nodes" select="exsl:node-set($components)/node()"/>
85 <when test="$component-nodes[string(.)='' or translate(., '0123456789ABCDEF', '')!='']">
86 <value-of select="substring-before($source, '<U+')"/>
88 <value-of select="$inner"/>
90 <call-template name="LesML:unescape">
91 <with-param name="source" select="substring-after($after, '>')"/>
95 <for-each select="$component-nodes">
96 <text disable-output-escaping="yes">&#x</text>
97 <value-of select="."/>
100 <call-template name="LesML:unescape">
101 <with-param name="source" select="substring-after($after, '>')"/>
107 <value-of select="substring-before($source, '<U+')"/>
109 <call-template name="LesML:unescape">
110 <with-param name="source" select="$after"/>
116 <value-of select="$source"/>
120 <template name="LesML:id-and-contents">
121 <param name="source"/>
123 <when test="starts-with($source, '¶')">
125 <when test="contains($source, ' ')">
126 <variable name="id" select="substring-before(substring-after($source, '¶'), ' ')"/>
128 <attribute name="id">
129 <value-of select="$id"/>
132 <value-of select="substring-after($source, ' ')"/>
135 <attribute name="id">
136 <value-of select="substring-after($source, '¶')"/>
142 <value-of select="$source"/>
146 <template name="LesML:parse">
147 <param name="lines" select="/.."/>
148 <param name="parent-params" select="/.."/>
149 <variable name="first-line" select="$lines[1]"/>
150 <variable name="shebang">
151 <if test="starts-with($first-line, '#!lesml')">
152 <value-of select="$first-line"/>
155 <variable name="params-string">
157 <when test="starts-with($shebang, '#!lesml@')">
158 <value-of select="substring-after($shebang, '$')"/>
161 <value-of select="substring-after($shebang, '#!lesml')"/>
165 <variable name="params-fragment">
167 <when test="$shebang!=''">
169 <if test="starts-with($shebang, '#!lesml@') and contains($shebang, '$')">
175 <value-of select="substring-before(substring-after($shebang, '#!lesml@'), '$')"/>
179 <for-each select="exslstr:tokenize($params-string)">
181 <when test="contains(., '=')">
184 <value-of select="substring-before(., '=')"/>
187 <value-of select="substring-after(., '=')"/>
194 <value-of select="."/>
203 <when test="$parent-params">
204 <copy-of select="$parent-params"/>
211 <variable name="params" select="exsl:node-set($params-fragment)/*"/>
212 <variable name="noshebang" select="$lines[position()>1 or not(starts-with(., '#!lesml') or starts-with(., '##'))]"/>
213 <variable name="docsep" select="$noshebang[starts-with(., '#!lesml') or starts-with(., '##')][1]"/>
214 <variable name="doclines" select="$noshebang[not($docsep) or following-sibling::*[generate-id()=generate-id($docsep)]]"/>
215 <if test="starts-with($first-line, '##') and $first-line!='##'">
217 <value-of select="substring-after($first-line, '##')"/>
220 <if test="$shebang!='' or $doclines[normalize-space()!='']">
221 <variable name="record-separators" select="$doclines[starts-with(., '%%')]"/>
223 <for-each select="$params/html:div/html:dt[string()=' LANG ']">
224 <attribute name="lang">
225 <value-of select="following-sibling::html:dd"/>
227 <attribute name="xml:lang">
228 <value-of select="following-sibling::html:dd"/>
231 <for-each select="$params/html:div/html:dt[string()='profile']">
232 <attribute name="data-lesml-profile">
233 <value-of select="following-sibling::html:dd"/>
236 <if test="$record-separators[preceding-sibling::*[normalize-space()!='']]">
237 <html:footer class="head">
238 <for-each select="$record-separators">
239 <variable name="position" select="position()"/>
240 <variable name="prev-separator" select="$record-separators[($position)-1]"/>
241 <variable name="fields" select="$noshebang[following-sibling::*[generate-id()=generate-id(current())] and (not($prev-separator) or preceding-sibling::*[generate-id()=generate-id($prev-separator)])]"/>
244 <for-each select="$fields">
246 <when test="starts-with(., ' ') and $fields[generate-id()=generate-id(current()/preceding-sibling::*[1])]"/>
248 <variable name="next" select="following-sibling::*[not(starts-with(., ' '))]"/>
251 <value-of select="normalize-space(substring-before(., ':'))"/>
254 <variable name="firstline">
256 <when test="contains(., ':')">
257 <value-of select="normalize-space(substring-after(., ':'))"/>
260 <value-of select="normalize-space(.)"/>
265 <when test="substring($firstline, string-length($firstline))='\' and following-sibling::*[position()=1 and starts-with(., ' ')]">
266 <value-of select="substring($firstline, 1, string-length($firstline)-1)"/>
269 <value-of select="$firstline"/>
272 <for-each select="following-sibling::*[starts-with(., ' ') and not(preceding-sibling::*[generate-id()=generate-id($next)])]">
273 <variable name="nextline" select="normalize-space(.)"/>
275 <when test="substring($nextline, string-length($nextline))='\' and following-sibling::*[position()=1 and starts-with(., ' ')]">
276 <value-of select="substring($nextline, 1, string-length($nextline)-1)"/>
279 <value-of select="$nextline"/>
292 <value-of select="substring-after(., '%%')"/>
298 <html:div class="body">
299 <call-template name="LesML:paragraphize">
300 <with-param name="lines" select="$doclines[not($record-separators) or preceding-sibling::*[generate-id()=generate-id($record-separators[last()])]]"/>
306 <call-template name="LesML:parse">
307 <with-param name="lines" select="$docsep|$lines[preceding-sibling::*[generate-id()=generate-id($docsep)]]"/>
308 <with-param name="parent-params" select="$params"/>
312 <template name="LesML:paragraphize">
313 <param name="lines" select="/.."/>
314 <variable name="last-lines" select="$lines[normalize-space()!='' and normalize-space(following-sibling::*[1])='']|$lines[last()]"/>
315 <variable name="blocked">
316 <for-each select="$last-lines">
317 <variable name="position" select="position()"/>
318 <variable name="prev-last" select="$last-lines[($position)-1]"/>
319 <variable name="linespans" select="$lines[following-sibling::*[generate-id()=generate-id(current())] and (not($prev-last) or preceding-sibling::*[generate-id()=generate-id($prev-last)]) and normalize-space()!='']|."/>
320 <variable name="quoted" select="not($linespans[not(starts-with(., ' ') or starts-with(., '	'))])"/>
321 <variable name="preformatted" select="not($linespans[not(starts-with(normalize-space(), '|'))])"/>
322 <variable name="text">
323 <for-each select="$linespans">
325 <when test="$preformatted">
326 <value-of select="substring-after(., '|')"/>
329 <value-of select="normalize-space()"/>
332 <if test="position()!=count($linespans)">
334 <when test="$preformatted">
344 <if test="string($text)!=''">
345 <variable name="par">
347 <when test="$preformatted">
349 <call-template name="LesML:id-and-contents">
350 <with-param name="source" select="$text"/>
354 <when test="starts-with($text, '⁌') and &sigiled-text;">
356 <call-template name="LesML:id-and-contents">
357 <with-param name="source" select="&unsigiled-text;"/>
361 <when test="starts-with($text, '§') and &sigiled-text;">
363 <call-template name="LesML:id-and-contents">
364 <with-param name="source" select="&unsigiled-text;"/>
368 <when test="starts-with($text, '❦') and &sigiled-text;">
370 <call-template name="LesML:id-and-contents">
371 <with-param name="source" select="&unsigiled-text;"/>
375 <when test="starts-with($text, '✠') and &sigiled-text;">
377 <call-template name="LesML:id-and-contents">
378 <with-param name="source" select="&unsigiled-text;"/>
382 <when test="starts-with($text, '•') and &sigiled-text;">
383 <html:li class="unordered" data-level="1">
385 <call-template name="LesML:id-and-contents">
386 <with-param name="source" select="&unsigiled-text;"/>
391 <when test="starts-with($text, '🔢') and &sigiled-text;">
392 <html:li class="ordered" data-level="1">
394 <call-template name="LesML:id-and-contents">
395 <with-param name="source" select="&unsigiled-text;"/>
400 <when test="starts-with($text, '◦') and &sigiled-text;">
401 <html:li class="unordered" data-level="2">
403 <call-template name="LesML:id-and-contents">
404 <with-param name="source" select="&unsigiled-text;"/>
409 <when test="starts-with($text, '🔠') and &sigiled-text;">
410 <html:li class="ordered" data-level="2">
412 <call-template name="LesML:id-and-contents">
413 <with-param name="source" select="&unsigiled-text;"/>
418 <when test="starts-with($text, '▪') and &sigiled-text;">
419 <html:li class="unordered" data-level="3">
421 <call-template name="LesML:id-and-contents">
422 <with-param name="source" select="&unsigiled-text;"/>
427 <when test="starts-with($text, '🔡') and &sigiled-text;">
428 <html:li class="ordered" data-level="3">
430 <call-template name="LesML:id-and-contents">
431 <with-param name="source" select="&unsigiled-text;"/>
436 <when test="starts-with($text, '⁃') and &sigiled-text;">
437 <html:li class="unordered" data-level="4">
439 <call-template name="LesML:id-and-contents">
440 <with-param name="source" select="&unsigiled-text;"/>
445 <when test="starts-with($text, '🔣') and &sigiled-text;">
446 <html:li class="ordered" data-level="4">
448 <call-template name="LesML:id-and-contents">
449 <with-param name="source" select="&unsigiled-text;"/>
454 <when test="starts-with($text, '🛈') and &sigiled-text;">
455 <html:div role="note" class="info">
457 <call-template name="LesML:id-and-contents">
458 <with-param name="source" select="&unsigiled-text;"/>
463 <when test="starts-with($text, '⯑') and &sigiled-text;">
464 <html:div role="note" class="query">
466 <call-template name="LesML:id-and-contents">
467 <with-param name="source" select="&unsigiled-text;"/>
472 <when test="starts-with($text, '⚠︎') and &sigiled-text;">
473 <html:div role="note" class="warn">
475 <call-template name="LesML:id-and-contents">
476 <with-param name="source" select="&unsigiled-text;"/>
481 <when test="starts-with($text, '※') and &sigiled-text;">
482 <html:div role="note" class="note">
484 <call-template name="LesML:id-and-contents">
485 <with-param name="source" select="&unsigiled-text;"/>
490 <when test="starts-with($text, '☡') and &sigiled-text;">
491 <html:div role="note" class="caution">
493 <call-template name="LesML:id-and-contents">
494 <with-param name="source" select="&unsigiled-text;"/>
499 <when test="starts-with($text, '⋯') and &sigiled-text;">
500 <html:div class="continuation">
502 <call-template name="LesML:id-and-contents">
503 <with-param name="source" select="&unsigiled-text;"/>
508 <when test="starts-with($text, '#') and &sigiled-text;">
510 <value-of select="&unsigiled-text;"/>
515 <call-template name="LesML:id-and-contents">
516 <with-param name="source" select="$text"/>
523 <when test="translate(string($text), '§ion-break; ', '')=''">
526 <when test="$quoted">
528 <copy-of select="$par"/>
532 <copy-of select="$par"/>
538 <variable name="inlined">
539 <apply-templates select="exsl:node-set($blocked)/node()" mode="LesML:linkify"/>
541 <apply-templates select="exsl:node-set($inlined)/node()" mode="LesML:finalize-tree"/>
543 <template match="html:script[@type='text/lesml']">
544 <variable name="lines-fragment">
545 <call-template name="LesML:split">
546 <with-param name="source">
547 <for-each select=".//text()">
548 <value-of select="."/>
553 <call-template name="LesML:parse">
554 <with-param name="lines" select="exsl:node-set($lines-fragment)/*"/>
557 <template match="@*|node()" mode="LesML:finalize-tree" priority="-1">
559 <apply-templates select="@*|node()" mode="LesML:finalize-tree"/>
562 <template match="text()" mode="LesML:finalize-tree">
563 <call-template name="LesML:break-and-unescape">
564 <with-param name="source" select="string(.)"/>
567 <template match="html:blockquote" mode="LesML:finalize-tree">
568 <if test="not(preceding-sibling::node()) or preceding-sibling::node()[position()=1 and not(self::html:blockquote)]">
569 <variable name="notquote" select="following-sibling::node()[not(self::html:blockquote)][1]"/>
570 <variable name="contents">
571 <copy-of select="node()"/>
572 <for-each select="following-sibling::node()[not($notquote) or following-sibling::node()[generate-id()=generate-id($notquote)]]">
573 <copy-of select="node()"/>
576 <variable name="content-nodes" select="exsl:node-set($contents)/node()"/>
577 <variable name="laststarttext" select="$content-nodes[last()]/self::html:p[not(@class) and not(@role)]/node()[self::text() or self::*][position()=1 and self::text()]"/>
579 <when test="starts-with($laststarttext, '— ')">
580 <variable name="caption">
581 <copy-of select="$laststarttext/preceding-sibling::node()"/>
582 <value-of select="substring-after($laststarttext, '— ')"/>
583 <copy-of select="$laststarttext/following-sibling::node()"/>
587 <apply-templates select="@*|$content-nodes[position()!=last()]" mode="LesML:finalize-tree"/>
590 <for-each select="$content-nodes[last()]">
592 <apply-templates select="@*|exsl:node-set($caption)/node()" mode="LesML:finalize-tree"/>
600 <apply-templates select="@*|$content-nodes" mode="LesML:finalize-tree"/>
606 <template match="html:div" mode="LesML:finalize-tree">
607 <if test="not(@class='continuation') or not(preceding-sibling::node()) or preceding-sibling::node()[position()=1 and not(self::html:div or self::html:li)]">
608 <variable name="notcontinuation" select="following-sibling::node()[not(self::html:div and @class='continuation')][1]"/>
610 <apply-templates select="@*|node()" mode="LesML:finalize-tree"/>
611 <for-each select="following-sibling::node()[not($notcontinuation) or following-sibling::node()[generate-id()=generate-id($notcontinuation)]]">
612 <apply-templates select="node()" mode="LesML:finalize-tree"/>
617 <template match="html:li" mode="LesML:finalize-tree">
618 <if test="not(preceding-sibling::node()) or preceding-sibling::node()[not(preceding-sibling::* and self::html:div and @class='continuation')][position()=1 and not(self::html:li)]">
619 <apply-templates select="." mode="LesML:finalize-list"/>
622 <template match="html:li" mode="LesML:finalize-list">
623 <param name="parent-level" select="0"/>
624 <variable name="current-class" select="string(@class)"/>
625 <variable name="current-level" select="number(@data-level)"/>
626 <variable name="wrapper">
628 <when test="@class='ordered'">
636 <variable name="notinlist" select="following-sibling::node()[not(self::html:div and @class='continuation' or self::html:li and (@data-level>$current-level or @data-level=$current-level and @class=$current-class))][1]"/>
637 <element name="html:{$wrapper}" namespace="http://www.w3.org/1999/xhtml">
638 <for-each select=".|following-sibling::html:li[@data-level=$current-level and (not($notinlist) or following-sibling::node()[generate-id()=generate-id($notinlist)])]">
639 <variable name="notcontinuation" select="following-sibling::node()[not(self::html:div and @class='continuation')][1]"/>
641 <apply-templates select="@*|node()" mode="LesML:finalize-tree"/>
642 <for-each select="following-sibling::node()[not($notcontinuation) or following-sibling::node()[generate-id()=generate-id($notcontinuation)]]">
643 <apply-templates select="node()" mode="LesML:finalize-tree"/>
645 <if test="$notcontinuation/self::html:li[@data-level>$current-level]">
646 <apply-templates select="$notcontinuation" mode="LesML:finalize-list">
647 <with-param name="parent-level" select="$current-level"/>
653 <if test="$notinlist/self::html:li[@data-level>$parent-level]">
654 <apply-templates select="$notinlist" mode="LesML:finalize-list">
655 <with-param name="parent-level" select="$parent-level"/>
659 <template match="node()" mode="LesML:inline">
660 <param name="element-name"/>
661 <param name="element-namespace" select="'http://www.w3.org/1999/xhtml'"/>
662 <param name="start-sigil"/>
663 <param name="end-sigil"/>
665 <param name="langtag-supported" select="false()"/>
667 <when test="self::*">
669 <copy-of select="@*"/>
670 <variable name="start-node" select="text()[contains(., $start-sigil)][1]"/>
672 <when test="$start-node">
673 <variable name="remaining">
674 <value-of select="substring-after($start-node, $start-sigil)"/>
675 <copy-of select="$start-node/following-sibling::node()"/>
677 <variable name="end-node" select="exsl:node-set($remaining)/node()[self::text() and contains(., $end-sigil)][1]"/>
679 <when test="$end-node">
680 <variable name="restoftext" select="substring-after($end-node, $end-sigil)"/>
681 <variable name="maybe-langtag">
682 <if test="$langtag-supported and starts-with($restoftext, '@') and contains($restoftext, '$')">
683 <value-of select="substring-before(substring-after($restoftext, '@'), '$')"/>
686 <variable name="langtag">
687 <if test="translate($maybe-langtag, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-', '')=''">
688 <value-of select="$maybe-langtag"/>
691 <variable name="rest">
694 <when test="string($langtag)!=''">
695 <value-of select="substring-after($restoftext, '$')"/>
698 <value-of select="$restoftext"/>
701 <copy-of select="$end-node/following-sibling::node()"/>
704 <variable name="processed-rest">
705 <apply-templates select="exsl:node-set($rest)/*" mode="LesML:inline">
706 <with-param name="element-name" select="$element-name"/>
707 <with-param name="element-namespace" select="$element-namespace"/>
708 <with-param name="start-sigil" select="$start-sigil"/>
709 <with-param name="end-sigil" select="$end-sigil"/>
710 <with-param name="role" select="$role"/>
711 <with-param name="langtag-supported" select="$langtag-supported"/>
714 <copy-of select="$start-node/preceding-sibling::node()"/>
715 <value-of select="substring-before($start-node, $start-sigil)"/>
716 <element name="{$element-name}" namespace="{$element-namespace}">
717 <if test="string($role)!=''">
718 <attribute name="role">
719 <value-of select="$role"/>
722 <if test="string($langtag)!=''">
723 <if test="$element-namespace='http://www.w3.org/1999/xhtml'">
724 <attribute name="lang">
725 <value-of select="$langtag"/>
728 <attribute name="xml:lang">
729 <value-of select="$langtag"/>
732 <copy-of select="$end-node/preceding-sibling::node()"/>
733 <value-of select="substring-before($end-node, $end-sigil)"/>
735 <copy-of select="exsl:node-set($processed-rest)/*/node()"/>
738 <apply-templates select="node()" mode="LesML:inline">
739 <with-param name="element-name" select="$element-name"/>
740 <with-param name="element-namespace" select="$element-namespace"/>
741 <with-param name="start-sigil" select="$start-sigil"/>
742 <with-param name="end-sigil" select="$end-sigil"/>
743 <with-param name="role" select="$role"/>
744 <with-param name="langtag-supported" select="$langtag-supported"/>
750 <apply-templates select="node()" mode="LesML:inline">
751 <with-param name="element-name" select="$element-name"/>
752 <with-param name="element-namespace" select="$element-namespace"/>
753 <with-param name="start-sigil" select="$start-sigil"/>
754 <with-param name="end-sigil" select="$end-sigil"/>
755 <with-param name="role" select="$role"/>
756 <with-param name="langtag-supported" select="$langtag-supported"/>
763 <copy-of select="."/>
767 <template match="node()" mode="LesML:linkify">
768 <variable name="result">
770 <when test="self::*">
772 <copy-of select="@*"/>
773 <variable name="start-node" select="text()[contains(., '{🔗')][1]"/>
775 <when test="$start-node">
776 <variable name="remaining">
777 <value-of select="substring-after($start-node, '{🔗')"/>
778 <copy-of select="$start-node/following-sibling::node()"/>
780 <variable name="end-node" select="exsl:node-set($remaining)/node()[self::text() and contains(., '>}') and not(preceding-sibling::*)][1]"/>
781 <variable name="hyperlink">
782 <for-each select="$end-node/preceding-sibling::node()">
783 <value-of select="."/>
785 <value-of select="substring-before($end-node, '>}')"/>
788 <when test="contains($hyperlink, '<')">
789 <variable name="ltcomponents">
790 <call-template name="LesML:split">
791 <with-param name="source" select="$hyperlink"/>
792 <with-param name="separator" select="'<'"/>
795 <variable name="ltcomponent-nodes" select="exsl:node-set($ltcomponents)/*"/>
796 <variable name="rest">
798 <value-of select="substring-after($end-node, '>}')"/>
799 <copy-of select="$end-node/following-sibling::node()"/>
802 <variable name="processed-rest">
803 <apply-templates select="exsl:node-set($rest)/*" mode="LesML:linkify"/>
805 <copy-of select="$start-node/preceding-sibling::node()"/>
806 <value-of select="substring-before($start-node, '{🔗')"/>
807 <html:a href="{$ltcomponent-nodes[last()]}">
809 <when test="count($ltcomponent-nodes)>2 or normalize-space($ltcomponent-nodes[1])!=''">
810 <value-of select="$ltcomponent-nodes[1]"/>
811 <for-each select="$ltcomponent-nodes[position()>1 and position()!=last()]">
813 <value-of select="."/>
817 <value-of select="$ltcomponent-nodes[last()]"/>
821 <copy-of select="exsl:node-set($processed-rest)/*/node()"/>
824 <variable name="rest">
826 <copy-of select="$remaining"/>
829 <variable name="processed-rest">
830 <apply-templates select="exsl:node-set($rest)/*" mode="LesML:linkify"/>
832 <copy-of select="$start-node/preceding-sibling::node()"/>
833 <value-of select="substring-before($start-node, '{🔗')"/>
835 <copy-of select="exsl:node-set($processed-rest)/*/node()"/>
840 <apply-templates select="node()" mode="LesML:linkify"/>
846 <copy-of select="."/>
850 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:strikethrough"/>
852 <template match="node()" mode="LesML:strikethrough">
853 <variable name="result">
854 <apply-templates select="." mode="LesML:inline">
855 <with-param name="element-name" select="'html:s'"/>
856 <with-param name="start-sigil" select="'⸠'"/>
857 <with-param name="end-sigil" select="'⸡'"/>
860 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:underline"/>
862 <template match="node()" mode="LesML:underline">
863 <variable name="result">
864 <apply-templates select="." mode="LesML:inline">
865 <with-param name="element-name" select="'html:u'"/>
866 <with-param name="start-sigil" select="'⸤'"/>
867 <with-param name="end-sigil" select="'⸥'"/>
870 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:noted"/>
872 <template match="node()" mode="LesML:noted">
873 <variable name="result">
874 <apply-templates select="." mode="LesML:inline">
875 <with-param name="element-name" select="'html:small'"/>
876 <with-param name="start-sigil" select="'⟦'"/>
877 <with-param name="end-sigil" select="'⟧'"/>
878 <with-param name="role" select="'note'"/>
881 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:parenthetical"/>
883 <template match="node()" mode="LesML:parenthetical">
884 <variable name="result">
885 <apply-templates select="." mode="LesML:inline">
886 <with-param name="element-name" select="'html:small'"/>
887 <with-param name="start-sigil" select="'⸨'"/>
888 <with-param name="end-sigil" select="'⸩'"/>
891 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:important"/>
893 <template match="node()" mode="LesML:important">
894 <variable name="result">
895 <apply-templates select="." mode="LesML:inline">
896 <with-param name="element-name" select="'html:strong'"/>
897 <with-param name="start-sigil" select="'☞'"/>
898 <with-param name="end-sigil" select="'☜'"/>
901 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:emphasized"/>
903 <template match="node()" mode="LesML:emphasized">
904 <variable name="result">
905 <apply-templates select="." mode="LesML:inline">
906 <with-param name="element-name" select="'html:em'"/>
907 <with-param name="start-sigil" select="'⹐'"/>
908 <with-param name="end-sigil" select="'⹑'"/>
911 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:titled"/>
913 <template match="node()" mode="LesML:titled">
914 <variable name="result">
915 <apply-templates select="." mode="LesML:inline">
916 <with-param name="element-name" select="'html:cite'"/>
917 <with-param name="start-sigil" select="'⟪'"/>
918 <with-param name="end-sigil" select="'⟫'"/>
921 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:offset"/>
923 <template match="node()" mode="LesML:offset">
924 <variable name="result">
925 <apply-templates select="." mode="LesML:inline">
926 <with-param name="element-name" select="'html:i'"/>
927 <with-param name="start-sigil" select="'⟨'"/>
928 <with-param name="end-sigil" select="'⟩'"/>
929 <with-param name="langtag-supported" select="true()"/>
932 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:bolded"/>
934 <template match="node()" mode="LesML:bolded">
935 <variable name="result">
936 <apply-templates select="." mode="LesML:inline">
937 <with-param name="element-name" select="'html:b'"/>
938 <with-param name="start-sigil" select="'⦃'"/>
939 <with-param name="end-sigil" select="'⦄'"/>
942 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:code"/>
944 <template match="node()" mode="LesML:code">
945 <apply-templates select="." mode="LesML:inline">
946 <with-param name="element-name" select="'html:code'"/>
947 <with-param name="start-sigil" select="'`'"/>
948 <with-param name="end-sigil" select="'´'"/>