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:unescape">
52 <param name="source"/>
54 <when test="contains($source, '<U+')">
55 <variable name="after" select="substring-after($source, '<U+')"/>
57 <when test="contains($after, '>')">
58 <variable name="inner" select="substring-before($after, '>')"/>
59 <variable name="components">
60 <call-template name="LesML:split">
61 <with-param name="source" select="$inner"/>
62 <with-param name="separator" select="'.'"/>
65 <variable name="component-nodes" select="exsl:node-set($components)/node()"/>
67 <when test="$component-nodes[string(.)='' or translate(., '0123456789ABCDEF', '')!='']">
68 <value-of select="substring-before($source, '<U+')"/>
70 <value-of select="$inner"/>
72 <call-template name="LesML:unescape">
73 <with-param name="source" select="substring-after($after, '>')"/>
77 <for-each select="$component-nodes">
78 <text disable-output-escaping="yes">&#x</text>
79 <value-of select="."/>
82 <call-template name="LesML:unescape">
83 <with-param name="source" select="substring-after($after, '>')"/>
89 <value-of select="substring-before($source, '<U+')"/>
91 <call-template name="LesML:unescape">
92 <with-param name="source" select="$after"/>
98 <value-of select="$source"/>
102 <template name="LesML:id-and-contents">
103 <param name="source"/>
105 <when test="starts-with($source, '¶')">
107 <when test="contains($source, ' ')">
108 <attribute name="id">
109 <value-of select="substring-before(substring-after($source, '¶'), ' ')"/>
111 <value-of select="substring-after($source, ' ')"/>
114 <attribute name="id">
115 <value-of select="substring-after($source, '¶')"/>
121 <value-of select="$source"/>
125 <template name="LesML:parse">
126 <param name="lines" select="/.."/>
127 <param name="parent-params" select="/.."/>
128 <variable name="first-line" select="$lines[1]"/>
129 <variable name="shebang">
130 <if test="starts-with($first-line, '#!lesml')">
131 <value-of select="$first-line"/>
134 <variable name="params-string">
136 <when test="starts-with($shebang, '#!lesml@')">
137 <value-of select="substring-after($shebang, '$')"/>
140 <value-of select="substring-after($shebang, '#!lesml')"/>
144 <variable name="params-fragment">
146 <when test="$shebang!=''">
148 <if test="starts-with($shebang, '#!lesml@') and contains($shebang, '$')">
154 <value-of select="substring-before(substring-after($shebang, '#!lesml@'), '$')"/>
158 <for-each select="exslstr:tokenize($params-string)">
160 <when test="contains(., '=')">
163 <value-of select="substring-before(., '=')"/>
166 <value-of select="substring-after(., '=')"/>
173 <value-of select="."/>
182 <when test="$parent-params">
183 <copy-of select="$parent-params"/>
190 <variable name="params" select="exsl:node-set($params-fragment)/*"/>
191 <variable name="noshebang" select="$lines[position()>1 or not(starts-with(., '#!lesml') or starts-with(., '##'))]"/>
192 <variable name="docsep" select="$noshebang[starts-with(., '#!lesml') or starts-with(., '##')][1]"/>
193 <variable name="doclines" select="$noshebang[not($docsep) or following-sibling::*[generate-id()=generate-id($docsep)]]"/>
194 <if test="starts-with($first-line, '##') and $first-line!='##'">
196 <value-of select="substring-after($first-line, '##')"/>
199 <if test="$shebang!='' or $doclines[normalize-space()!='']">
200 <variable name="record-separators" select="$doclines[starts-with(., '%%')]"/>
202 <for-each select="$params/html:div/html:dt[string()=' LANG ']">
203 <attribute name="lang">
204 <value-of select="following-sibling::html:dd"/>
206 <attribute name="xml:lang">
207 <value-of select="following-sibling::html:dd"/>
210 <for-each select="$params/html:div/html:dt[string()='profile']">
211 <attribute name="data-lesml-profile">
212 <value-of select="following-sibling::html:dd"/>
215 <if test="$record-separators[preceding-sibling::*[normalize-space()!='']]">
216 <html:footer class="head">
217 <for-each select="$record-separators">
218 <variable name="position" select="position()"/>
219 <variable name="prev-separator" select="$record-separators[($position)-1]"/>
220 <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)])]"/>
223 <for-each select="$fields">
225 <when test="starts-with(., ' ') and $fields[generate-id()=generate-id(current()/preceding-sibling::*[1])]"/>
227 <variable name="next" select="following-sibling::*[not(starts-with(., ' '))]"/>
230 <value-of select="normalize-space(substring-before(., ':'))"/>
233 <variable name="firstline">
235 <when test="contains(., ':')">
236 <value-of select="normalize-space(substring-after(., ':'))"/>
239 <value-of select="normalize-space(.)"/>
244 <when test="substring($firstline, string-length($firstline))='\' and following-sibling::*[position()=1 and starts-with(., ' ')]">
245 <value-of select="substring($firstline, 1, string-length($firstline)-1)"/>
248 <value-of select="$firstline"/>
251 <for-each select="following-sibling::*[starts-with(., ' ') and not(preceding-sibling::*[generate-id()=generate-id($next)])]">
252 <variable name="nextline" select="normalize-space(.)"/>
254 <when test="substring($nextline, string-length($nextline))='\' and following-sibling::*[position()=1 and starts-with(., ' ')]">
255 <value-of select="substring($nextline, 1, string-length($nextline)-1)"/>
258 <value-of select="$nextline"/>
271 <value-of select="substring-after(., '%%')"/>
277 <html:div class="body">
278 <call-template name="LesML:paragraphize">
279 <with-param name="lines" select="$doclines[not($record-separators) or preceding-sibling::*[generate-id()=generate-id($record-separators[last()])]]"/>
285 <call-template name="LesML:parse">
286 <with-param name="lines" select="$docsep|$lines[preceding-sibling::*[generate-id()=generate-id($docsep)]]"/>
287 <with-param name="parent-params" select="$params"/>
291 <template name="LesML:paragraphize">
292 <param name="lines" select="/.."/>
293 <variable name="last-lines" select="$lines[normalize-space()!='' and normalize-space(following-sibling::*[1])='']|$lines[last()]"/>
294 <variable name="blocked">
295 <for-each select="$last-lines">
296 <variable name="position" select="position()"/>
297 <variable name="prev-last" select="$last-lines[($position)-1]"/>
298 <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()!='']|."/>
299 <variable name="quoted" select="not($linespans[not(starts-with(., ' ') or starts-with(., '	'))])"/>
300 <variable name="text">
301 <for-each select="$linespans">
302 <value-of select="normalize-space()"/>
303 <if test="position()!=count($linespans)">
308 <if test="string($text)!=''">
309 <variable name="par">
311 <when test="starts-with($text, '⁌') and &sigiled-text;">
313 <call-template name="LesML:id-and-contents">
314 <with-param name="source" select="&unsigiled-text;"/>
318 <when test="starts-with($text, '§') and &sigiled-text;">
320 <call-template name="LesML:id-and-contents">
321 <with-param name="source" select="&unsigiled-text;"/>
325 <when test="starts-with($text, '❦') and &sigiled-text;">
327 <call-template name="LesML:id-and-contents">
328 <with-param name="source" select="&unsigiled-text;"/>
332 <when test="starts-with($text, '✠') and &sigiled-text;">
334 <call-template name="LesML:id-and-contents">
335 <with-param name="source" select="&unsigiled-text;"/>
339 <when test="starts-with($text, '•') and &sigiled-text;">
340 <html:li class="unordered" data-level="1">
342 <call-template name="LesML:id-and-contents">
343 <with-param name="source" select="&unsigiled-text;"/>
348 <when test="starts-with($text, '🔢') and &sigiled-text;">
349 <html:li class="ordered" data-level="1">
351 <call-template name="LesML:id-and-contents">
352 <with-param name="source" select="&unsigiled-text;"/>
357 <when test="starts-with($text, '◦') and &sigiled-text;">
358 <html:li class="unordered" data-level="2">
360 <call-template name="LesML:id-and-contents">
361 <with-param name="source" select="&unsigiled-text;"/>
366 <when test="starts-with($text, '🔠') and &sigiled-text;">
367 <html:li class="ordered" data-level="2">
369 <call-template name="LesML:id-and-contents">
370 <with-param name="source" select="&unsigiled-text;"/>
375 <when test="starts-with($text, '▪') and &sigiled-text;">
376 <html:li class="unordered" data-level="3">
378 <call-template name="LesML:id-and-contents">
379 <with-param name="source" select="&unsigiled-text;"/>
384 <when test="starts-with($text, '🔡') and &sigiled-text;">
385 <html:li class="ordered" data-level="3">
387 <call-template name="LesML:id-and-contents">
388 <with-param name="source" select="&unsigiled-text;"/>
393 <when test="starts-with($text, '⁃') and &sigiled-text;">
394 <html:li class="unordered" data-level="4">
396 <call-template name="LesML:id-and-contents">
397 <with-param name="source" select="&unsigiled-text;"/>
402 <when test="starts-with($text, '🔣') and &sigiled-text;">
403 <html:li class="ordered" data-level="4">
405 <call-template name="LesML:id-and-contents">
406 <with-param name="source" select="&unsigiled-text;"/>
411 <when test="starts-with($text, '🛈') and &sigiled-text;">
412 <html:div role="note" class="info">
414 <call-template name="LesML:id-and-contents">
415 <with-param name="source" select="&unsigiled-text;"/>
420 <when test="starts-with($text, '⯑') and &sigiled-text;">
421 <html:div role="note" class="query">
423 <call-template name="LesML:id-and-contents">
424 <with-param name="source" select="&unsigiled-text;"/>
429 <when test="starts-with($text, '⚠︎') and &sigiled-text;">
430 <html:div role="note" class="warn">
432 <call-template name="LesML:id-and-contents">
433 <with-param name="source" select="&unsigiled-text;"/>
438 <when test="starts-with($text, '※') and &sigiled-text;">
439 <html:div role="note" class="note">
441 <call-template name="LesML:id-and-contents">
442 <with-param name="source" select="&unsigiled-text;"/>
447 <when test="starts-with($text, '☡') and &sigiled-text;">
448 <html:div role="note" class="caution">
450 <call-template name="LesML:id-and-contents">
451 <with-param name="source" select="&unsigiled-text;"/>
456 <when test="starts-with($text, '⋯') and &sigiled-text;">
457 <html:div class="continuation">
459 <call-template name="LesML:id-and-contents">
460 <with-param name="source" select="&unsigiled-text;"/>
465 <when test="starts-with($text, '#') and &sigiled-text;">
467 <value-of select="&unsigiled-text;"/>
472 <call-template name="LesML:id-and-contents">
473 <with-param name="source" select="$text"/>
480 <when test="translate(string($text), '§ion-break; ', '')=''">
483 <when test="$quoted">
485 <copy-of select="$par"/>
489 <copy-of select="$par"/>
495 <variable name="inlined">
496 <apply-templates select="exsl:node-set($blocked)/node()" mode="LesML:linkify"/>
498 <apply-templates select="exsl:node-set($inlined)/node()" mode="LesML:finalize-tree"/>
500 <template match="html:script[@type='text/lesml']">
501 <variable name="lines-fragment">
502 <call-template name="LesML:split">
503 <with-param name="source">
504 <for-each select=".//text()">
505 <value-of select="."/>
510 <call-template name="LesML:parse">
511 <with-param name="lines" select="exsl:node-set($lines-fragment)/*"/>
514 <template match="@*|node()" mode="LesML:finalize-tree" priority="-1">
516 <apply-templates select="@*|node()" mode="LesML:finalize-tree"/>
519 <template match="text()" mode="LesML:finalize-tree">
520 <call-template name="LesML:unescape">
521 <with-param name="source" select="string(.)"/>
524 <template match="html:blockquote" mode="LesML:finalize-tree">
525 <if test="not(preceding-sibling::node()) or preceding-sibling::node()[position()=1 and not(self::html:blockquote)]">
526 <variable name="notquote" select="following-sibling::node()[not(self::html:blockquote)][1]"/>
527 <variable name="contents">
528 <copy-of select="node()"/>
529 <for-each select="following-sibling::node()[not($notquote) or following-sibling::node()[generate-id()=generate-id($notquote)]]">
530 <copy-of select="node()"/>
533 <variable name="content-nodes" select="exsl:node-set($contents)/node()"/>
534 <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()]"/>
536 <when test="starts-with($laststarttext, '— ')">
537 <variable name="caption">
538 <copy-of select="$laststarttext/preceding-sibling::node()"/>
539 <value-of select="substring-after($laststarttext, '— ')"/>
540 <copy-of select="$laststarttext/following-sibling::node()"/>
544 <apply-templates select="@*|$content-nodes[position()!=last()]" mode="LesML:finalize-tree"/>
547 <for-each select="$content-nodes[last()]">
549 <apply-templates select="@*|exsl:node-set($caption)/node()" mode="LesML:finalize-tree"/>
557 <apply-templates select="@*|$content-nodes" mode="LesML:finalize-tree"/>
563 <template match="html:div" mode="LesML:finalize-tree">
564 <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)]">
565 <variable name="notcontinuation" select="following-sibling::node()[not(self::html:div and @class='continuation')][1]"/>
567 <apply-templates select="@*|node()" mode="LesML:finalize-tree"/>
568 <for-each select="following-sibling::node()[not($notcontinuation) or following-sibling::node()[generate-id()=generate-id($notcontinuation)]]">
569 <apply-templates select="node()" mode="LesML:finalize-tree"/>
574 <template match="html:li" mode="LesML:finalize-tree">
575 <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)]">
576 <apply-templates select="." mode="LesML:finalize-list"/>
579 <template match="html:li" mode="LesML:finalize-list">
580 <param name="parent-level" select="0"/>
581 <variable name="current-class" select="string(@class)"/>
582 <variable name="current-level" select="number(@data-level)"/>
583 <variable name="wrapper">
585 <when test="@class='ordered'">
593 <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]"/>
594 <element name="html:{$wrapper}" namespace="http://www.w3.org/1999/xhtml">
595 <for-each select=".|following-sibling::html:li[@data-level=$current-level and (not($notinlist) or following-sibling::node()[generate-id()=generate-id($notinlist)])]">
596 <variable name="notcontinuation" select="following-sibling::node()[not(self::html:div and @class='continuation')][1]"/>
598 <apply-templates select="@*|node()" mode="LesML:finalize-tree"/>
599 <for-each select="following-sibling::node()[not($notcontinuation) or following-sibling::node()[generate-id()=generate-id($notcontinuation)]]">
600 <apply-templates select="node()" mode="LesML:finalize-tree"/>
602 <if test="$notcontinuation/self::html:li[@data-level>$current-level]">
603 <apply-templates select="$notcontinuation" mode="LesML:finalize-list">
604 <with-param name="parent-level" select="$current-level"/>
610 <if test="$notinlist/self::html:li[@data-level>$parent-level]">
611 <apply-templates select="$notinlist" mode="LesML:finalize-list">
612 <with-param name="parent-level" select="$parent-level"/>
616 <template match="node()" mode="LesML:inline">
617 <param name="element-name"/>
618 <param name="element-namespace" select="'http://www.w3.org/1999/xhtml'"/>
619 <param name="start-sigil"/>
620 <param name="end-sigil"/>
622 <param name="langtag-supported" select="false()"/>
624 <when test="self::*">
626 <copy-of select="@*"/>
627 <variable name="start-node" select="text()[contains(., $start-sigil)][1]"/>
629 <when test="$start-node">
630 <variable name="remaining">
631 <value-of select="substring-after($start-node, $start-sigil)"/>
632 <copy-of select="$start-node/following-sibling::node()"/>
634 <variable name="end-node" select="exsl:node-set($remaining)/node()[self::text() and contains(., $end-sigil)][1]"/>
636 <when test="$end-node">
637 <variable name="restoftext" select="substring-after($end-node, $end-sigil)"/>
638 <variable name="maybe-langtag">
639 <if test="$langtag-supported and starts-with($restoftext, '@') and contains($restoftext, '$')">
640 <value-of select="substring-before(substring-after($restoftext, '@'), '$')"/>
643 <variable name="langtag">
644 <if test="translate($maybe-langtag, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-', '')=''">
645 <value-of select="$maybe-langtag"/>
648 <variable name="rest">
651 <when test="string($langtag)!=''">
652 <value-of select="substring-after($restoftext, '$')"/>
655 <value-of select="$restoftext"/>
658 <copy-of select="$end-node/following-sibling::node()"/>
661 <variable name="processed-rest">
662 <apply-templates select="exsl:node-set($rest)/*" mode="LesML:inline">
663 <with-param name="element-name" select="$element-name"/>
664 <with-param name="element-namespace" select="$element-namespace"/>
665 <with-param name="start-sigil" select="$start-sigil"/>
666 <with-param name="end-sigil" select="$end-sigil"/>
667 <with-param name="role" select="$role"/>
668 <with-param name="langtag-supported" select="$langtag-supported"/>
671 <copy-of select="$start-node/preceding-sibling::node()"/>
672 <value-of select="substring-before($start-node, $start-sigil)"/>
673 <element name="{$element-name}" namespace="{$element-namespace}">
674 <if test="string($role)!=''">
675 <attribute name="role">
676 <value-of select="$role"/>
679 <if test="string($langtag)!=''">
680 <if test="$element-namespace='http://www.w3.org/1999/xhtml'">
681 <attribute name="lang">
682 <value-of select="$langtag"/>
685 <attribute name="xml:lang">
686 <value-of select="$langtag"/>
689 <copy-of select="$end-node/preceding-sibling::node()"/>
690 <value-of select="substring-before($end-node, $end-sigil)"/>
692 <copy-of select="exsl:node-set($processed-rest)/*/node()"/>
695 <apply-templates select="node()" mode="LesML:inline">
696 <with-param name="element-name" select="$element-name"/>
697 <with-param name="element-namespace" select="$element-namespace"/>
698 <with-param name="start-sigil" select="$start-sigil"/>
699 <with-param name="end-sigil" select="$end-sigil"/>
700 <with-param name="role" select="$role"/>
701 <with-param name="langtag-supported" select="$langtag-supported"/>
707 <apply-templates select="node()" mode="LesML:inline">
708 <with-param name="element-name" select="$element-name"/>
709 <with-param name="element-namespace" select="$element-namespace"/>
710 <with-param name="start-sigil" select="$start-sigil"/>
711 <with-param name="end-sigil" select="$end-sigil"/>
712 <with-param name="role" select="$role"/>
713 <with-param name="langtag-supported" select="$langtag-supported"/>
720 <copy-of select="."/>
724 <template match="node()" mode="LesML:linkify">
725 <variable name="result">
727 <when test="self::*">
729 <copy-of select="@*"/>
730 <variable name="start-node" select="text()[contains(., '{🔗')][1]"/>
732 <when test="$start-node">
733 <variable name="remaining">
734 <value-of select="substring-after($start-node, '{🔗')"/>
735 <copy-of select="$start-node/following-sibling::node()"/>
737 <variable name="end-node" select="exsl:node-set($remaining)/node()[self::text() and contains(., '>}') and not(preceding-sibling::*)][1]"/>
738 <variable name="hyperlink">
739 <for-each select="$end-node/preceding-sibling::node()">
740 <value-of select="."/>
742 <value-of select="substring-before($end-node, '>}')"/>
745 <when test="contains($hyperlink, '<')">
746 <variable name="ltcomponents">
747 <call-template name="LesML:split">
748 <with-param name="source" select="$hyperlink"/>
749 <with-param name="separator" select="'<'"/>
752 <variable name="ltcomponent-nodes" select="exsl:node-set($ltcomponents)/*"/>
753 <variable name="rest">
755 <value-of select="substring-after($end-node, '>}')"/>
756 <copy-of select="$end-node/following-sibling::node()"/>
759 <variable name="processed-rest">
760 <apply-templates select="exsl:node-set($rest)/*" mode="LesML:linkify"/>
762 <copy-of select="$start-node/preceding-sibling::node()"/>
763 <value-of select="substring-before($start-node, '{🔗')"/>
764 <html:a href="{$ltcomponent-nodes[last()]}">
766 <when test="count($ltcomponent-nodes)>2 or normalize-space($ltcomponent-nodes[1])!=''">
767 <value-of select="$ltcomponent-nodes[1]"/>
768 <for-each select="$ltcomponent-nodes[position()>1 and position()!=last()]">
770 <value-of select="."/>
774 <value-of select="$ltcomponent-nodes[last()]"/>
778 <copy-of select="exsl:node-set($processed-rest)/*/node()"/>
781 <variable name="rest">
783 <copy-of select="$remaining"/>
786 <variable name="processed-rest">
787 <apply-templates select="exsl:node-set($rest)/*" mode="LesML:linkify"/>
789 <copy-of select="$start-node/preceding-sibling::node()"/>
790 <value-of select="substring-before($start-node, '{🔗')"/>
792 <copy-of select="exsl:node-set($processed-rest)/*/node()"/>
797 <apply-templates select="node()" mode="LesML:linkify"/>
803 <copy-of select="."/>
807 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:strikethrough"/>
809 <template match="node()" mode="LesML:strikethrough">
810 <variable name="result">
811 <apply-templates select="." mode="LesML:inline">
812 <with-param name="element-name" select="'html:s'"/>
813 <with-param name="start-sigil" select="'⸠'"/>
814 <with-param name="end-sigil" select="'⸡'"/>
817 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:underline"/>
819 <template match="node()" mode="LesML:underline">
820 <variable name="result">
821 <apply-templates select="." mode="LesML:inline">
822 <with-param name="element-name" select="'html:u'"/>
823 <with-param name="start-sigil" select="'⸤'"/>
824 <with-param name="end-sigil" select="'⸥'"/>
827 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:noted"/>
829 <template match="node()" mode="LesML:noted">
830 <variable name="result">
831 <apply-templates select="." mode="LesML:inline">
832 <with-param name="element-name" select="'html:small'"/>
833 <with-param name="start-sigil" select="'⟦'"/>
834 <with-param name="end-sigil" select="'⟧'"/>
835 <with-param name="role" select="'note'"/>
838 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:parenthetical"/>
840 <template match="node()" mode="LesML:parenthetical">
841 <variable name="result">
842 <apply-templates select="." mode="LesML:inline">
843 <with-param name="element-name" select="'html:small'"/>
844 <with-param name="start-sigil" select="'⸨'"/>
845 <with-param name="end-sigil" select="'⸩'"/>
848 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:important"/>
850 <template match="node()" mode="LesML:important">
851 <variable name="result">
852 <apply-templates select="." mode="LesML:inline">
853 <with-param name="element-name" select="'html:strong'"/>
854 <with-param name="start-sigil" select="'☞'"/>
855 <with-param name="end-sigil" select="'☜'"/>
858 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:emphasized"/>
860 <template match="node()" mode="LesML:emphasized">
861 <variable name="result">
862 <apply-templates select="." mode="LesML:inline">
863 <with-param name="element-name" select="'html:em'"/>
864 <with-param name="start-sigil" select="'⹐'"/>
865 <with-param name="end-sigil" select="'⹑'"/>
868 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:titled"/>
870 <template match="node()" mode="LesML:titled">
871 <variable name="result">
872 <apply-templates select="." mode="LesML:inline">
873 <with-param name="element-name" select="'html:cite'"/>
874 <with-param name="start-sigil" select="'⟪'"/>
875 <with-param name="end-sigil" select="'⟫'"/>
878 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:offset"/>
880 <template match="node()" mode="LesML:offset">
881 <variable name="result">
882 <apply-templates select="." mode="LesML:inline">
883 <with-param name="element-name" select="'html:i'"/>
884 <with-param name="start-sigil" select="'⟨'"/>
885 <with-param name="end-sigil" select="'⟩'"/>
886 <with-param name="langtag-supported" select="true()"/>
889 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:bolded"/>
891 <template match="node()" mode="LesML:bolded">
892 <variable name="result">
893 <apply-templates select="." mode="LesML:inline">
894 <with-param name="element-name" select="'html:b'"/>
895 <with-param name="start-sigil" select="'⦃'"/>
896 <with-param name="end-sigil" select="'⦄'"/>
899 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:code"/>
901 <template match="node()" mode="LesML:code">
902 <apply-templates select="." mode="LesML:inline">
903 <with-param name="element-name" select="'html:code'"/>
904 <with-param name="start-sigil" select="'`'"/>
905 <with-param name="end-sigil" select="'´'"/>