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 '*-.=_~·․‥…⁂⋯─━┄┅┈┉╌╍═╴╶╸╺☙❧ ・*-.=_~'>
18 xmlns="http://www.w3.org/1999/XSL/Transform"
19 xmlns:LesML="urn:fdc:ladys.computer:20240512:LesML"
20 xmlns:exsl="http://exslt.org/common"
21 xmlns:exslstr="http://exslt.org/strings"
22 xmlns:html="http://www.w3.org/1999/xhtml"
23 xmlns:书社="urn:fdc:ladys.computer:20231231:Shu1She4"
24 exclude-result-prefixes="LesML"
25 extension-element-prefixes="exsl exslstr"
28 <书社:id>urn:fdc:ladys.computer:20240512:LesML:parser.xslt</书社:id>
29 <template name="LesML:split">
30 <param name="source"/>
31 <param name="separator" select="'
'"/>
33 <when test="contains($source, $separator)">
35 <value-of select="substring-before($source, $separator)"/>
37 <call-template name="LesML:split">
38 <with-param name="source" select="substring-after($source, $separator)"/>
39 <with-param name="separator" select="$separator"/>
44 <value-of select="$source"/>
49 <template name="LesML:unescape">
50 <param name="source"/>
52 <when test="contains($source, '<U+')">
53 <variable name="after" select="substring-after($source, '<U+')"/>
55 <when test="contains($after, '>')">
56 <variable name="inner" select="substring-before($after, '>')"/>
57 <variable name="components">
58 <call-template name="LesML:split">
59 <with-param name="source" select="$inner"/>
60 <with-param name="separator" select="'.'"/>
63 <variable name="component-nodes" select="exsl:node-set($components)/node()"/>
65 <when test="$component-nodes[string(.)='' or translate(., '0123456789ABCDEF', '')!='']">
66 <value-of select="substring-before($source, '<U+')"/>
68 <value-of select="$inner"/>
70 <call-template name="LesML:unescape">
71 <with-param name="source" select="substring-after($after, '>')"/>
75 <for-each select="$component-nodes">
76 <text disable-output-escaping="yes">&#x</text>
77 <value-of select="."/>
80 <call-template name="LesML:unescape">
81 <with-param name="source" select="substring-after($after, '>')"/>
87 <value-of select="substring-before($source, '<U+')"/>
89 <call-template name="LesML:unescape">
90 <with-param name="source" select="$after"/>
96 <value-of select="$source"/>
100 <template name="LesML:id-and-contents">
101 <param name="source"/>
103 <when test="starts-with($source, '¶')">
105 <when test="contains($source, ' ')">
106 <attribute name="id">
107 <value-of select="substring-before(substring-after($source, '¶'), ' ')"/>
109 <value-of select="substring-after($source, ' ')"/>
112 <attribute name="id">
113 <value-of select="substring-after($source, '¶')"/>
119 <value-of select="$source"/>
123 <template name="LesML:parse">
124 <param name="lines" select="/.."/>
125 <param name="parent-params" select="/.."/>
126 <variable name="first-line" select="$lines[1]"/>
127 <variable name="shebang">
128 <if test="starts-with($first-line, '#!lesml')">
129 <value-of select="$first-line"/>
132 <variable name="params-string">
134 <when test="starts-with($shebang, '#!lesml@')">
135 <value-of select="substring-after($shebang, '$')"/>
138 <value-of select="substring-after($shebang, '#!lesml')"/>
142 <variable name="params-fragment">
144 <when test="$shebang!=''">
146 <if test="starts-with($shebang, '#!lesml@') and contains($shebang, '$')">
152 <value-of select="substring-before(substring-after($shebang, '#!lesml@'), '$')"/>
156 <for-each select="exslstr:tokenize($params-string)">
158 <when test="contains(., '=')">
161 <value-of select="substring-before(., '=')"/>
164 <value-of select="substring-after(., '=')"/>
171 <value-of select="."/>
180 <when test="$parent-params">
181 <copy-of select="$parent-params"/>
188 <variable name="params" select="exsl:node-set($params-fragment)/*"/>
189 <variable name="noshebang" select="$lines[position()>1 or not(starts-with(., '#!lesml') or starts-with(., '##'))]"/>
190 <variable name="docsep" select="$noshebang[starts-with(., '#!lesml') or starts-with(., '##')][1]"/>
191 <variable name="doclines" select="$noshebang[not($docsep) or following-sibling::*[generate-id()=generate-id($docsep)]]"/>
192 <if test="starts-with($first-line, '##') and $first-line!='##'">
194 <value-of select="substring-after($first-line, '##')"/>
197 <if test="$shebang!='' or $doclines[normalize-space()!='']">
198 <variable name="record-separators" select="$doclines[starts-with(., '%%')]"/>
200 <for-each select="$params/html:div/html:dt[string()=' LANG ']">
201 <attribute name="lang">
202 <value-of select="following-sibling::html:dd"/>
204 <attribute name="xml:lang">
205 <value-of select="following-sibling::html:dd"/>
208 <for-each select="$params/html:div/html:dt[string()='profile']">
209 <attribute name="data-lesml-profile">
210 <value-of select="following-sibling::html:dd"/>
213 <if test="$record-separators[preceding-sibling::*[normalize-space()!='']]">
214 <html:footer class="head">
215 <for-each select="$record-separators">
216 <variable name="position" select="position()"/>
217 <variable name="prev-separator" select="$record-separators[($position)-1]"/>
218 <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)])]"/>
221 <for-each select="$fields">
223 <when test="starts-with(., ' ') and $fields[generate-id()=generate-id(current()/preceding-sibling::*[1])]"/>
225 <variable name="next" select="following-sibling::*[not(starts-with(., ' '))]"/>
228 <value-of select="normalize-space(substring-before(., ':'))"/>
231 <variable name="firstline">
233 <when test="contains(., ':')">
234 <value-of select="normalize-space(substring-after(., ':'))"/>
237 <value-of select="normalize-space(.)"/>
242 <when test="substring($firstline, string-length($firstline))='\' and following-sibling::*[position()=1 and starts-with(., ' ')]">
243 <value-of select="substring($firstline, 1, string-length($firstline)-1)"/>
246 <value-of select="$firstline"/>
249 <for-each select="following-sibling::*[starts-with(., ' ') and not(preceding-sibling::*[generate-id()=generate-id($next)])]">
250 <variable name="nextline" select="normalize-space(.)"/>
252 <when test="substring($nextline, string-length($nextline))='\' and following-sibling::*[position()=1 and starts-with(., ' ')]">
253 <value-of select="substring($nextline, 1, string-length($nextline)-1)"/>
256 <value-of select="$nextline"/>
269 <value-of select="substring-after(., '%%')"/>
275 <html:div class="body">
276 <call-template name="LesML:paragraphize">
277 <with-param name="lines" select="$doclines[not($record-separators) or preceding-sibling::*[generate-id()=generate-id($record-separators[last()])]]"/>
283 <call-template name="LesML:parse">
284 <with-param name="lines" select="$docsep|$lines[preceding-sibling::*[generate-id()=generate-id($docsep)]]"/>
285 <with-param name="parent-params" select="$params"/>
289 <template name="LesML:paragraphize">
290 <param name="lines" select="/.."/>
291 <variable name="last-lines" select="$lines[normalize-space()!='' and normalize-space(following-sibling::*[1])='']|$lines[last()]"/>
292 <variable name="blocked">
293 <for-each select="$last-lines">
294 <variable name="position" select="position()"/>
295 <variable name="prev-last" select="$last-lines[($position)-1]"/>
296 <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()!='']|."/>
297 <variable name="quoted" select="not($linespans[not(starts-with(., ' ') or starts-with(., '	'))])"/>
298 <variable name="text">
299 <for-each select="$linespans">
300 <value-of select="normalize-space()"/>
301 <if test="position()!=count($linespans)">
306 <if test="string($text)!=''">
307 <variable name="par">
309 <when test="starts-with($text, '⁌ ')">
311 <call-template name="LesML:id-and-contents">
312 <with-param name="source" select="substring-after($text, '⁌ ')"/>
316 <when test="starts-with($text, '§ ')">
318 <call-template name="LesML:id-and-contents">
319 <with-param name="source" select="substring-after($text, '§ ')"/>
323 <when test="starts-with($text, '❦ ')">
325 <call-template name="LesML:id-and-contents">
326 <with-param name="source" select="substring-after($text, '❦ ')"/>
330 <when test="starts-with($text, '✠ ')">
332 <call-template name="LesML:id-and-contents">
333 <with-param name="source" select="substring-after($text, '✠ ')"/>
337 <when test="starts-with($text, '• ')">
338 <html:li class="unordered" data-level="1">
340 <call-template name="LesML:id-and-contents">
341 <with-param name="source" select="substring-after($text, '• ')"/>
346 <when test="starts-with($text, '🔢 ')">
347 <html:li class="ordered" data-level="1">
349 <call-template name="LesML:id-and-contents">
350 <with-param name="source" select="substring-after($text, '🔢 ')"/>
355 <when test="starts-with($text, '◦ ')">
356 <html:li class="unordered" data-level="2">
358 <call-template name="LesML:id-and-contents">
359 <with-param name="source" select="substring-after($text, '◦ ')"/>
364 <when test="starts-with($text, '🔠 ')">
365 <html:li class="ordered" data-level="2">
367 <call-template name="LesML:id-and-contents">
368 <with-param name="source" select="substring-after($text, '🔠 ')"/>
373 <when test="starts-with($text, '▪ ')">
374 <html:li class="unordered" data-level="3">
376 <call-template name="LesML:id-and-contents">
377 <with-param name="source" select="substring-after($text, '▪ ')"/>
382 <when test="starts-with($text, '🔡 ')">
383 <html:li class="ordered" data-level="3">
385 <call-template name="LesML:id-and-contents">
386 <with-param name="source" select="substring-after($text, '🔡 ')"/>
391 <when test="starts-with($text, '⁃ ')">
392 <html:li class="unordered" data-level="4">
394 <call-template name="LesML:id-and-contents">
395 <with-param name="source" select="substring-after($text, '⁃ ')"/>
400 <when test="starts-with($text, '🔣 ')">
401 <html:li class="ordered" data-level="4">
403 <call-template name="LesML:id-and-contents">
404 <with-param name="source" select="substring-after($text, '🔣 ')"/>
409 <when test="starts-with($text, '🛈 ')">
410 <html:div role="note" class="info">
412 <call-template name="LesML:id-and-contents">
413 <with-param name="source" select="substring-after($text, '🛈 ')"/>
418 <when test="starts-with($text, '⯑ ')">
419 <html:div role="note" class="query">
421 <call-template name="LesML:id-and-contents">
422 <with-param name="source" select="substring-after($text, '⯑ ')"/>
427 <when test="starts-with($text, '⚠︎ ')">
428 <html:div role="note" class="warn">
430 <call-template name="LesML:id-and-contents">
431 <with-param name="source" select="substring-after($text, '⚠︎ ')"/>
436 <when test="starts-with($text, '※ ')">
437 <html:div role="note" class="note">
439 <call-template name="LesML:id-and-contents">
440 <with-param name="source" select="substring-after($text, '※ ')"/>
445 <when test="starts-with($text, '☡ ')">
446 <html:div role="note" class="caution">
448 <call-template name="LesML:id-and-contents">
449 <with-param name="source" select="substring-after($text, '☡ ')"/>
454 <when test="starts-with($text, '⋯ ')">
455 <html:div class="continuation">
457 <call-template name="LesML:id-and-contents">
458 <with-param name="source" select="substring-after($text, '⋯ ')"/>
463 <when test="starts-with($text, '# ')">
465 <value-of select="substring-after($text, '# ')"/>
470 <call-template name="LesML:id-and-contents">
471 <with-param name="source" select="$text"/>
478 <when test="translate(string($text), '§ion-break; ', '')=''">
481 <when test="$quoted">
483 <copy-of select="$par"/>
487 <copy-of select="$par"/>
493 <variable name="inlined">
494 <apply-templates select="exsl:node-set($blocked)/node()" mode="LesML:linkify"/>
496 <apply-templates select="exsl:node-set($inlined)/node()" mode="LesML:finalize-tree"/>
498 <template match="html:script[@type='text/lesml']">
499 <variable name="lines-fragment">
500 <call-template name="LesML:split">
501 <with-param name="source">
502 <for-each select=".//text()">
503 <value-of select="."/>
508 <call-template name="LesML:parse">
509 <with-param name="lines" select="exsl:node-set($lines-fragment)/*"/>
512 <template match="@*|node()" mode="LesML:finalize-tree" priority="-1">
514 <apply-templates select="@*|node()" mode="LesML:finalize-tree"/>
517 <template match="text()" mode="LesML:finalize-tree">
518 <call-template name="LesML:unescape">
519 <with-param name="source" select="string(.)"/>
522 <template match="html:blockquote" mode="LesML:finalize-tree">
523 <if test="not(preceding-sibling::node()) or preceding-sibling::node()[position()=1 and not(self::html:blockquote)]">
524 <variable name="notquote" select="following-sibling::node()[not(self::html:blockquote)][1]"/>
525 <variable name="contents">
526 <copy-of select="node()"/>
527 <for-each select="following-sibling::node()[not($notquote) or following-sibling::node()[generate-id()=generate-id($notquote)]]">
528 <copy-of select="node()"/>
531 <variable name="content-nodes" select="exsl:node-set($contents)/node()"/>
532 <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()]"/>
534 <when test="starts-with($laststarttext, '— ')">
535 <variable name="caption">
536 <copy-of select="$laststarttext/preceding-sibling::node()"/>
537 <value-of select="substring-after($laststarttext, '— ')"/>
538 <copy-of select="$laststarttext/following-sibling::node()"/>
542 <apply-templates select="@*|$content-nodes[position()!=last()]" mode="LesML:finalize-tree"/>
545 <for-each select="$content-nodes[last()]">
547 <apply-templates select="@*|exsl:node-set($caption)/node()" mode="LesML:finalize-tree"/>
555 <apply-templates select="@*|$content-nodes" mode="LesML:finalize-tree"/>
561 <template match="html:div" mode="LesML:finalize-tree">
562 <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)]">
563 <variable name="notcontinuation" select="following-sibling::node()[not(self::html:div and @class='continuation')][1]"/>
565 <apply-templates select="@*|node()" mode="LesML:finalize-tree"/>
566 <for-each select="following-sibling::node()[not($notcontinuation) or following-sibling::node()[generate-id()=generate-id($notcontinuation)]]">
567 <apply-templates select="node()" mode="LesML:finalize-tree"/>
572 <template match="html:li" mode="LesML:finalize-tree">
573 <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)]">
574 <apply-templates select="." mode="LesML:finalize-list"/>
577 <template match="html:li" mode="LesML:finalize-list">
578 <param name="parent-level" select="0"/>
579 <variable name="current-class" select="string(@class)"/>
580 <variable name="current-level" select="number(@data-level)"/>
581 <variable name="wrapper">
583 <when test="@class='ordered'">
591 <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]"/>
592 <element name="html:{$wrapper}" namespace="http://www.w3.org/1999/xhtml">
593 <for-each select=".|following-sibling::html:li[@data-level=$current-level and (not($notinlist) or following-sibling::node()[generate-id()=generate-id($notinlist)])]">
594 <variable name="notcontinuation" select="following-sibling::node()[not(self::html:div and @class='continuation')][1]"/>
596 <apply-templates select="@*|node()" mode="LesML:finalize-tree"/>
597 <for-each select="following-sibling::node()[not($notcontinuation) or following-sibling::node()[generate-id()=generate-id($notcontinuation)]]">
598 <apply-templates select="node()" mode="LesML:finalize-tree"/>
600 <if test="$notcontinuation/self::html:li[@data-level>$current-level]">
601 <apply-templates select="$notcontinuation" mode="LesML:finalize-list">
602 <with-param name="parent-level" select="$current-level"/>
608 <if test="$notinlist/self::html:li[@data-level>$parent-level]">
609 <apply-templates select="$notinlist" mode="LesML:finalize-list">
610 <with-param name="parent-level" select="$parent-level"/>
614 <template match="node()" mode="LesML:inline">
615 <param name="element-name"/>
616 <param name="element-namespace" select="'http://www.w3.org/1999/xhtml'"/>
617 <param name="start-sigil"/>
618 <param name="end-sigil"/>
620 <param name="langtag-supported" select="false()"/>
622 <when test="self::*">
624 <copy-of select="@*"/>
625 <variable name="start-node" select="text()[contains(., $start-sigil)][1]"/>
627 <when test="$start-node">
628 <variable name="remaining">
629 <value-of select="substring-after($start-node, $start-sigil)"/>
630 <copy-of select="$start-node/following-sibling::node()"/>
632 <variable name="end-node" select="exsl:node-set($remaining)/node()[self::text() and contains(., $end-sigil)][1]"/>
634 <when test="$end-node">
635 <variable name="restoftext" select="substring-after($end-node, $end-sigil)"/>
636 <variable name="maybe-langtag">
637 <if test="$langtag-supported and starts-with($restoftext, '@') and contains($restoftext, '$')">
638 <value-of select="substring-before(substring-after($restoftext, '@'), '$')"/>
641 <variable name="langtag">
642 <if test="translate($maybe-langtag, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-', '')=''">
643 <value-of select="$maybe-langtag"/>
646 <variable name="rest">
649 <when test="string($langtag)!=''">
650 <value-of select="substring-after($restoftext, '$')"/>
653 <value-of select="$restoftext"/>
656 <copy-of select="$end-node/following-sibling::node()"/>
659 <variable name="processed-rest">
660 <apply-templates select="exsl:node-set($rest)/*" mode="LesML:inline">
661 <with-param name="element-name" select="$element-name"/>
662 <with-param name="element-namespace" select="$element-namespace"/>
663 <with-param name="start-sigil" select="$start-sigil"/>
664 <with-param name="end-sigil" select="$end-sigil"/>
665 <with-param name="role" select="$role"/>
666 <with-param name="langtag-supported" select="$langtag-supported"/>
669 <copy-of select="$start-node/preceding-sibling::node()"/>
670 <value-of select="substring-before($start-node, $start-sigil)"/>
671 <element name="{$element-name}" namespace="{$element-namespace}">
672 <if test="string($role)!=''">
673 <attribute name="role">
674 <value-of select="$role"/>
677 <if test="string($langtag)!=''">
678 <if test="$element-namespace='http://www.w3.org/1999/xhtml'">
679 <attribute name="lang">
680 <value-of select="$langtag"/>
683 <attribute name="xml:lang">
684 <value-of select="$langtag"/>
687 <copy-of select="$end-node/preceding-sibling::node()"/>
688 <value-of select="substring-before($end-node, $end-sigil)"/>
690 <copy-of select="exsl:node-set($processed-rest)/*/node()"/>
693 <apply-templates select="node()" mode="LesML:inline">
694 <with-param name="element-name" select="$element-name"/>
695 <with-param name="element-namespace" select="$element-namespace"/>
696 <with-param name="start-sigil" select="$start-sigil"/>
697 <with-param name="end-sigil" select="$end-sigil"/>
698 <with-param name="role" select="$role"/>
699 <with-param name="langtag-supported" select="$langtag-supported"/>
705 <apply-templates select="node()" 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"/>
718 <copy-of select="."/>
722 <template match="node()" mode="LesML:linkify">
723 <variable name="result">
725 <when test="self::*">
727 <copy-of select="@*"/>
728 <variable name="start-node" select="text()[contains(., '{🔗')][1]"/>
730 <when test="$start-node">
731 <variable name="remaining">
732 <value-of select="substring-after($start-node, '{🔗')"/>
733 <copy-of select="$start-node/following-sibling::node()"/>
735 <variable name="end-node" select="exsl:node-set($remaining)/node()[self::text() and contains(., '>}') and not(preceding-sibling::*)][1]"/>
736 <variable name="hyperlink">
737 <for-each select="$end-node/preceding-sibling::node()">
738 <value-of select="."/>
740 <value-of select="substring-before($end-node, '>}')"/>
743 <when test="contains($hyperlink, '<')">
744 <variable name="ltcomponents">
745 <call-template name="LesML:split">
746 <with-param name="source" select="$hyperlink"/>
747 <with-param name="separator" select="'<'"/>
750 <variable name="ltcomponent-nodes" select="exsl:node-set($ltcomponents)/*"/>
751 <variable name="rest">
753 <value-of select="substring-after($end-node, '>}')"/>
754 <copy-of select="$end-node/following-sibling::node()"/>
757 <variable name="processed-rest">
758 <apply-templates select="exsl:node-set($rest)/*" mode="LesML:linkify"/>
760 <copy-of select="$start-node/preceding-sibling::node()"/>
761 <value-of select="substring-before($start-node, '{🔗')"/>
762 <html:a href="{$ltcomponent-nodes[last()]}">
764 <when test="count($ltcomponent-nodes)>2 or normalize-space($ltcomponent-nodes[1])!=''">
765 <value-of select="$ltcomponent-nodes[1]"/>
766 <for-each select="$ltcomponent-nodes[position()>1 and position()!=last()]">
768 <value-of select="."/>
772 <value-of select="$ltcomponent-nodes[last()]"/>
776 <copy-of select="exsl:node-set($processed-rest)/*/node()"/>
779 <variable name="rest">
781 <copy-of select="$remaining"/>
784 <variable name="processed-rest">
785 <apply-templates select="exsl:node-set($rest)/*" mode="LesML:linkify"/>
787 <copy-of select="$start-node/preceding-sibling::node()"/>
788 <value-of select="substring-before($start-node, '{🔗')"/>
790 <copy-of select="exsl:node-set($processed-rest)/*/node()"/>
795 <apply-templates select="node()" mode="LesML:linkify"/>
801 <copy-of select="."/>
805 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:strikethrough"/>
807 <template match="node()" mode="LesML:strikethrough">
808 <variable name="result">
809 <apply-templates select="." mode="LesML:inline">
810 <with-param name="element-name" select="'html:s'"/>
811 <with-param name="start-sigil" select="'⸠'"/>
812 <with-param name="end-sigil" select="'⸡'"/>
815 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:underline"/>
817 <template match="node()" mode="LesML:underline">
818 <variable name="result">
819 <apply-templates select="." mode="LesML:inline">
820 <with-param name="element-name" select="'html:u'"/>
821 <with-param name="start-sigil" select="'⸤'"/>
822 <with-param name="end-sigil" select="'⸥'"/>
825 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:noted"/>
827 <template match="node()" mode="LesML:noted">
828 <variable name="result">
829 <apply-templates select="." mode="LesML:inline">
830 <with-param name="element-name" select="'html:small'"/>
831 <with-param name="start-sigil" select="'⟦'"/>
832 <with-param name="end-sigil" select="'⟧'"/>
833 <with-param name="role" select="'note'"/>
836 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:parenthetical"/>
838 <template match="node()" mode="LesML:parenthetical">
839 <variable name="result">
840 <apply-templates select="." mode="LesML:inline">
841 <with-param name="element-name" select="'html:small'"/>
842 <with-param name="start-sigil" select="'⸨'"/>
843 <with-param name="end-sigil" select="'⸩'"/>
846 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:important"/>
848 <template match="node()" mode="LesML:important">
849 <variable name="result">
850 <apply-templates select="." mode="LesML:inline">
851 <with-param name="element-name" select="'html:strong'"/>
852 <with-param name="start-sigil" select="'☞'"/>
853 <with-param name="end-sigil" select="'☜'"/>
856 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:emphasized"/>
858 <template match="node()" mode="LesML:emphasized">
859 <variable name="result">
860 <apply-templates select="." mode="LesML:inline">
861 <with-param name="element-name" select="'html:em'"/>
862 <with-param name="start-sigil" select="'⹐'"/>
863 <with-param name="end-sigil" select="'⹑'"/>
866 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:titled"/>
868 <template match="node()" mode="LesML:titled">
869 <variable name="result">
870 <apply-templates select="." mode="LesML:inline">
871 <with-param name="element-name" select="'html:cite'"/>
872 <with-param name="start-sigil" select="'⟪'"/>
873 <with-param name="end-sigil" select="'⟫'"/>
876 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:offset"/>
878 <template match="node()" mode="LesML:offset">
879 <variable name="result">
880 <apply-templates select="." mode="LesML:inline">
881 <with-param name="element-name" select="'html:i'"/>
882 <with-param name="start-sigil" select="'⟨'"/>
883 <with-param name="end-sigil" select="'⟩'"/>
884 <with-param name="langtag-supported" select="true()"/>
887 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:bolded"/>
889 <template match="node()" mode="LesML:bolded">
890 <variable name="result">
891 <apply-templates select="." mode="LesML:inline">
892 <with-param name="element-name" select="'html:b'"/>
893 <with-param name="start-sigil" select="'⦃'"/>
894 <with-param name="end-sigil" select="'⦄'"/>
897 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:code"/>
899 <template match="node()" mode="LesML:code">
900 <apply-templates select="." mode="LesML:inline">
901 <with-param name="element-name" select="'html:code'"/>
902 <with-param name="start-sigil" select="'`'"/>
903 <with-param name="end-sigil" select="'´'"/>