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="noshebang" select="$lines[position()>1 or not(starts-with(., '#!lesml') or starts-with(., '##'))]"/>
133 <variable name="params-string">
135 <when test="starts-with($shebang, '#!lesml@')">
136 <value-of select="substring-after($shebang, '$')"/>
139 <value-of select="substring-after($shebang, '#!lesml')"/>
143 <variable name="params-fragment">
145 <if test="starts-with($shebang, '#!lesml@') and contains($shebang, '$')">
151 <value-of select="substring-before(substring-after($shebang, '#!lesml@'), '$')"/>
155 <for-each select="exslstr:tokenize($params-string)">
157 <when test="contains(., '=')">
160 <value-of select="substring-before(., '=')"/>
163 <value-of select="substring-after(., '=')"/>
170 <value-of select="."/>
179 <variable name="params" select="exsl:node-set($params-fragment)/*"/>
180 <variable name="record-separators" select="$noshebang[starts-with(., '%%')]"/>
182 <for-each select="$params/html:div/html:dt[string()=' LANG ']">
183 <attribute name="lang">
184 <value-of select="following-sibling::html:dd"/>
186 <attribute name="xml:lang">
187 <value-of select="following-sibling::html:dd"/>
190 <for-each select="$params/html:div/html:dt[string()='profile']">
191 <attribute name="data-lesml-profile">
192 <value-of select="following-sibling::html:dd"/>
195 <if test="count($record-separators)>1">
196 <html:footer class="head">
197 <for-each select="$record-separators">
198 <variable name="position" select="position()"/>
199 <variable name="prev-separator" select="$record-separators[($position)-1]"/>
200 <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)])]"/>
203 <for-each select="$fields">
205 <when test="starts-with(., ' ') and $fields[generate-id()=generate-id(current()/preceding-sibling::*[1])]"/>
207 <variable name="next" select="following-sibling::*[not(starts-with(., ' '))]"/>
210 <value-of select="normalize-space(substring-before(., ':'))"/>
213 <variable name="firstline">
215 <when test="contains(., ':')">
216 <value-of select="normalize-space(substring-after(., ':'))"/>
219 <value-of select="normalize-space(.)"/>
224 <when test="substring($firstline, string-length($firstline))='\' and following-sibling::*[position()=1 and starts-with(., ' ')]">
225 <value-of select="substring($firstline, 1, string-length($firstline)-1)"/>
228 <value-of select="$firstline"/>
231 <for-each select="following-sibling::*[starts-with(., ' ') and not(preceding-sibling::*[generate-id()=generate-id($next)])]">
232 <variable name="nextline" select="normalize-space(.)"/>
234 <when test="substring($nextline, string-length($nextline))='\' and following-sibling::*[position()=1 and starts-with(., ' ')]">
235 <value-of select="substring($nextline, 1, string-length($nextline)-1)"/>
238 <value-of select="$nextline"/>
252 <html:div class="body">
253 <call-template name="LesML:paragraphize">
254 <with-param name="lines" select="$noshebang[not($record-separators) or preceding-sibling::*[generate-id()=generate-id($record-separators[last()])]]"/>
259 <template name="LesML:paragraphize">
260 <param name="lines" select="/.."/>
261 <variable name="last-lines" select="$lines[normalize-space()!='' and normalize-space(following-sibling::*[1])='']|$lines[last()]"/>
262 <variable name="blocked">
263 <for-each select="$last-lines">
264 <variable name="position" select="position()"/>
265 <variable name="prev-last" select="$last-lines[($position)-1]"/>
266 <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()!='']|."/>
267 <variable name="quoted" select="not($linespans[not(starts-with(., ' ') or starts-with(., '	'))])"/>
268 <variable name="text">
269 <for-each select="$linespans">
270 <value-of select="normalize-space()"/>
271 <if test="position()!=count($linespans)">
276 <if test="string($text)!=''">
277 <variable name="par">
279 <when test="starts-with($text, '⁌ ')">
281 <call-template name="LesML:id-and-contents">
282 <with-param name="source" select="substring-after($text, '⁌ ')"/>
286 <when test="starts-with($text, '§ ')">
288 <call-template name="LesML:id-and-contents">
289 <with-param name="source" select="substring-after($text, '§ ')"/>
293 <when test="starts-with($text, '❦ ')">
295 <call-template name="LesML:id-and-contents">
296 <with-param name="source" select="substring-after($text, '❦ ')"/>
300 <when test="starts-with($text, '✠ ')">
302 <call-template name="LesML:id-and-contents">
303 <with-param name="source" select="substring-after($text, '✠ ')"/>
307 <when test="starts-with($text, '• ')">
308 <html:li class="unordered" data-level="1">
310 <call-template name="LesML:id-and-contents">
311 <with-param name="source" select="substring-after($text, '• ')"/>
316 <when test="starts-with($text, '🔢 ')">
317 <html:li class="ordered" data-level="1">
319 <call-template name="LesML:id-and-contents">
320 <with-param name="source" select="substring-after($text, '🔢 ')"/>
325 <when test="starts-with($text, '◦ ')">
326 <html:li class="unordered" data-level="2">
328 <call-template name="LesML:id-and-contents">
329 <with-param name="source" select="substring-after($text, '◦ ')"/>
334 <when test="starts-with($text, '🔠 ')">
335 <html:li class="ordered" data-level="2">
337 <call-template name="LesML:id-and-contents">
338 <with-param name="source" select="substring-after($text, '🔠 ')"/>
343 <when test="starts-with($text, '▪ ')">
344 <html:li class="unordered" data-level="3">
346 <call-template name="LesML:id-and-contents">
347 <with-param name="source" select="substring-after($text, '▪ ')"/>
352 <when test="starts-with($text, '🔡 ')">
353 <html:li class="ordered" data-level="3">
355 <call-template name="LesML:id-and-contents">
356 <with-param name="source" select="substring-after($text, '🔡 ')"/>
361 <when test="starts-with($text, '⁃ ')">
362 <html:li class="unordered" data-level="4">
364 <call-template name="LesML:id-and-contents">
365 <with-param name="source" select="substring-after($text, '⁃ ')"/>
370 <when test="starts-with($text, '🔣 ')">
371 <html:li class="ordered" data-level="4">
373 <call-template name="LesML:id-and-contents">
374 <with-param name="source" select="substring-after($text, '🔣 ')"/>
379 <when test="starts-with($text, '🛈 ')">
380 <html:div role="note" class="info">
382 <call-template name="LesML:id-and-contents">
383 <with-param name="source" select="substring-after($text, '🛈 ')"/>
388 <when test="starts-with($text, '⯑ ')">
389 <html:div role="note" class="query">
391 <call-template name="LesML:id-and-contents">
392 <with-param name="source" select="substring-after($text, '⯑ ')"/>
397 <when test="starts-with($text, '⚠︎ ')">
398 <html:div role="note" class="warn">
400 <call-template name="LesML:id-and-contents">
401 <with-param name="source" select="substring-after($text, '⚠︎ ')"/>
406 <when test="starts-with($text, '※ ')">
407 <html:div role="note" class="note">
409 <call-template name="LesML:id-and-contents">
410 <with-param name="source" select="substring-after($text, '※ ')"/>
415 <when test="starts-with($text, '☡ ')">
416 <html:div role="note" class="caution">
418 <call-template name="LesML:id-and-contents">
419 <with-param name="source" select="substring-after($text, '☡ ')"/>
424 <when test="starts-with($text, '⋯ ')">
425 <html:div class="continuation">
427 <call-template name="LesML:id-and-contents">
428 <with-param name="source" select="substring-after($text, '⋯ ')"/>
435 <call-template name="LesML:id-and-contents">
436 <with-param name="source" select="$text"/>
443 <when test="translate(string($text), '§ion-break; ', '')=''">
446 <when test="$quoted">
448 <copy-of select="$par"/>
452 <copy-of select="$par"/>
458 <variable name="inlined">
459 <apply-templates select="exsl:node-set($blocked)/node()" mode="LesML:linkify"/>
461 <apply-templates select="exsl:node-set($inlined)/node()" mode="LesML:finalize-tree"/>
463 <template match="html:script[@type='text/lesml']">
464 <variable name="lines-fragment">
465 <call-template name="LesML:split">
466 <with-param name="source">
467 <for-each select=".//text()">
468 <value-of select="."/>
473 <call-template name="LesML:parse">
474 <with-param name="lines" select="exsl:node-set($lines-fragment)/*"/>
477 <template match="@*|node()" mode="LesML:finalize-tree" priority="-1">
479 <apply-templates select="@*|node()" mode="LesML:finalize-tree"/>
482 <template match="text()" mode="LesML:finalize-tree">
483 <call-template name="LesML:unescape">
484 <with-param name="source" select="string(.)"/>
487 <template match="html:blockquote" mode="LesML:finalize-tree">
488 <if test="not(preceding-sibling::node()) or preceding-sibling::node()[position()=1 and not(self::html:blockquote)]">
489 <variable name="notquote" select="following-sibling::node()[not(self::html:blockquote)][1]"/>
490 <variable name="contents">
491 <copy-of select="node()"/>
492 <for-each select="following-sibling::node()[not($notquote) or following-sibling::node()[generate-id()=generate-id($notquote)]]">
493 <copy-of select="node()"/>
496 <variable name="content-nodes" select="exsl:node-set($contents)/node()"/>
497 <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()]"/>
499 <when test="starts-with($laststarttext, '— ')">
500 <variable name="caption">
501 <copy-of select="$laststarttext/preceding-sibling::node()"/>
502 <value-of select="substring-after($laststarttext, '— ')"/>
503 <copy-of select="$laststarttext/following-sibling::node()"/>
507 <apply-templates select="@*|$content-nodes[position()!=last()]" mode="LesML:finalize-tree"/>
510 <for-each select="$content-nodes[last()]">
512 <apply-templates select="@*|exsl:node-set($caption)/node()" mode="LesML:finalize-tree"/>
520 <apply-templates select="@*|$content-nodes" mode="LesML:finalize-tree"/>
526 <template match="html:div" mode="LesML:finalize-tree">
527 <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)]">
528 <variable name="notcontinuation" select="following-sibling::node()[not(self::html:div and @class='continuation')][1]"/>
530 <apply-templates select="@*|node()" mode="LesML:finalize-tree"/>
531 <for-each select="following-sibling::node()[not($notcontinuation) or following-sibling::node()[generate-id()=generate-id($notcontinuation)]]">
532 <apply-templates select="node()" mode="LesML:finalize-tree"/>
537 <template match="html:li" mode="LesML:finalize-tree">
538 <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)]">
539 <apply-templates select="." mode="LesML:finalize-list"/>
542 <template match="html:li" mode="LesML:finalize-list">
543 <param name="parent-level" select="0"/>
544 <variable name="current-class" select="string(@class)"/>
545 <variable name="current-level" select="number(@data-level)"/>
546 <variable name="wrapper">
548 <when test="@class='ordered'">
556 <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]"/>
557 <element name="html:{$wrapper}" namespace="http://www.w3.org/1999/xhtml">
558 <for-each select=".|following-sibling::html:li[@data-level=$current-level and (not($notinlist) or following-sibling::node()[generate-id()=generate-id($notinlist)])]">
559 <variable name="notcontinuation" select="following-sibling::node()[not(self::html:div and @class='continuation')][1]"/>
561 <apply-templates select="@*|node()" mode="LesML:finalize-tree"/>
562 <for-each select="following-sibling::node()[not($notcontinuation) or following-sibling::node()[generate-id()=generate-id($notcontinuation)]]">
563 <apply-templates select="node()" mode="LesML:finalize-tree"/>
565 <if test="$notcontinuation/self::html:li[@data-level>$current-level]">
566 <apply-templates select="$notcontinuation" mode="LesML:finalize-list">
567 <with-param name="parent-level" select="$current-level"/>
573 <if test="$notinlist/self::html:li[@data-level>$parent-level]">
574 <apply-templates select="$notinlist" mode="LesML:finalize-list">
575 <with-param name="parent-level" select="$parent-level"/>
579 <template match="node()" mode="LesML:inline">
580 <param name="element-name"/>
581 <param name="element-namespace" select="'http://www.w3.org/1999/xhtml'"/>
582 <param name="start-sigil"/>
583 <param name="end-sigil"/>
585 <param name="langtag-supported" select="false()"/>
587 <when test="self::*">
589 <copy-of select="@*"/>
590 <variable name="start-node" select="text()[contains(., $start-sigil)][1]"/>
592 <when test="$start-node">
593 <variable name="remaining">
594 <value-of select="substring-after($start-node, $start-sigil)"/>
595 <copy-of select="$start-node/following-sibling::node()"/>
597 <variable name="end-node" select="exsl:node-set($remaining)/node()[self::text() and contains(., $end-sigil)][1]"/>
599 <when test="$end-node">
600 <variable name="restoftext" select="substring-after($end-node, $end-sigil)"/>
601 <variable name="maybe-langtag">
602 <if test="$langtag-supported and starts-with($restoftext, '@') and contains($restoftext, '$')">
603 <value-of select="substring-before(substring-after($restoftext, '@'), '$')"/>
606 <variable name="langtag">
607 <if test="translate($maybe-langtag, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-', '')=''">
608 <value-of select="$maybe-langtag"/>
611 <variable name="rest">
614 <when test="string($langtag)!=''">
615 <value-of select="substring-after($restoftext, '$')"/>
618 <value-of select="$restoftext"/>
621 <copy-of select="$end-node/following-sibling::node()"/>
624 <variable name="processed-rest">
625 <apply-templates select="exsl:node-set($rest)/*" mode="LesML:inline">
626 <with-param name="element-name" select="$element-name"/>
627 <with-param name="element-namespace" select="$element-namespace"/>
628 <with-param name="start-sigil" select="$start-sigil"/>
629 <with-param name="end-sigil" select="$end-sigil"/>
630 <with-param name="role" select="$role"/>
631 <with-param name="langtag-supported" select="$langtag-supported"/>
634 <copy-of select="$start-node/preceding-sibling::node()"/>
635 <value-of select="substring-before($start-node, $start-sigil)"/>
636 <element name="{$element-name}" namespace="{$element-namespace}">
637 <if test="string($role)!=''">
638 <attribute name="role">
639 <value-of select="$role"/>
642 <if test="string($langtag)!=''">
643 <if test="$element-namespace='http://www.w3.org/1999/xhtml'">
644 <attribute name="lang">
645 <value-of select="$langtag"/>
648 <attribute name="xml:lang">
649 <value-of select="$langtag"/>
652 <copy-of select="$end-node/preceding-sibling::node()"/>
653 <value-of select="substring-before($end-node, $end-sigil)"/>
655 <copy-of select="exsl:node-set($processed-rest)/*/node()"/>
658 <apply-templates select="node()" mode="LesML:inline">
659 <with-param name="element-name" select="$element-name"/>
660 <with-param name="element-namespace" select="$element-namespace"/>
661 <with-param name="start-sigil" select="$start-sigil"/>
662 <with-param name="end-sigil" select="$end-sigil"/>
663 <with-param name="role" select="$role"/>
664 <with-param name="langtag-supported" select="$langtag-supported"/>
670 <apply-templates select="node()" mode="LesML:inline">
671 <with-param name="element-name" select="$element-name"/>
672 <with-param name="element-namespace" select="$element-namespace"/>
673 <with-param name="start-sigil" select="$start-sigil"/>
674 <with-param name="end-sigil" select="$end-sigil"/>
675 <with-param name="role" select="$role"/>
676 <with-param name="langtag-supported" select="$langtag-supported"/>
683 <copy-of select="."/>
687 <template match="node()" mode="LesML:linkify">
688 <variable name="result">
690 <when test="self::*">
692 <copy-of select="@*"/>
693 <variable name="start-node" select="text()[contains(., '{🔗')][1]"/>
695 <when test="$start-node">
696 <variable name="remaining">
697 <value-of select="substring-after($start-node, '{🔗')"/>
698 <copy-of select="$start-node/following-sibling::node()"/>
700 <variable name="end-node" select="exsl:node-set($remaining)/node()[self::text() and contains(., '>}') and not(preceding-sibling::*)][1]"/>
701 <variable name="hyperlink">
702 <for-each select="$end-node/preceding-sibling::node()">
703 <value-of select="."/>
705 <value-of select="substring-before($end-node, '>}')"/>
708 <when test="contains($hyperlink, '<')">
709 <variable name="ltcomponents">
710 <call-template name="LesML:split">
711 <with-param name="source" select="$hyperlink"/>
712 <with-param name="separator" select="'<'"/>
715 <variable name="ltcomponent-nodes" select="exsl:node-set($ltcomponents)/*"/>
716 <variable name="rest">
718 <value-of select="substring-after($end-node, '>}')"/>
719 <copy-of select="$end-node/following-sibling::node()"/>
722 <variable name="processed-rest">
723 <apply-templates select="exsl:node-set($rest)/*" mode="LesML:linkify"/>
725 <copy-of select="$start-node/preceding-sibling::node()"/>
726 <value-of select="substring-before($start-node, '{🔗')"/>
727 <html:a href="{$ltcomponent-nodes[last()]}">
729 <when test="count($ltcomponent-nodes)>2 or normalize-space($ltcomponent-nodes[1])!=''">
730 <value-of select="$ltcomponent-nodes[1]"/>
731 <for-each select="$ltcomponent-nodes[position()>1 and position()!=last()]">
733 <value-of select="."/>
737 <value-of select="$ltcomponent-nodes[last()]"/>
741 <copy-of select="exsl:node-set($processed-rest)/*/node()"/>
744 <variable name="rest">
746 <copy-of select="$remaining"/>
749 <variable name="processed-rest">
750 <apply-templates select="exsl:node-set($rest)/*" mode="LesML:linkify"/>
752 <copy-of select="$start-node/preceding-sibling::node()"/>
753 <value-of select="substring-before($start-node, '{🔗')"/>
755 <copy-of select="exsl:node-set($processed-rest)/*/node()"/>
760 <apply-templates select="node()" mode="LesML:linkify"/>
766 <copy-of select="."/>
770 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:strikethrough"/>
772 <template match="node()" mode="LesML:strikethrough">
773 <variable name="result">
774 <apply-templates select="." mode="LesML:inline">
775 <with-param name="element-name" select="'html:s'"/>
776 <with-param name="start-sigil" select="'⸠'"/>
777 <with-param name="end-sigil" select="'⸡'"/>
780 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:underline"/>
782 <template match="node()" mode="LesML:underline">
783 <variable name="result">
784 <apply-templates select="." mode="LesML:inline">
785 <with-param name="element-name" select="'html:u'"/>
786 <with-param name="start-sigil" select="'⸤'"/>
787 <with-param name="end-sigil" select="'⸥'"/>
790 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:noted"/>
792 <template match="node()" mode="LesML:noted">
793 <variable name="result">
794 <apply-templates select="." mode="LesML:inline">
795 <with-param name="element-name" select="'html:small'"/>
796 <with-param name="start-sigil" select="'⟦'"/>
797 <with-param name="end-sigil" select="'⟧'"/>
798 <with-param name="role" select="'note'"/>
801 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:parenthetical"/>
803 <template match="node()" mode="LesML:parenthetical">
804 <variable name="result">
805 <apply-templates select="." mode="LesML:inline">
806 <with-param name="element-name" select="'html:small'"/>
807 <with-param name="start-sigil" select="'⸨'"/>
808 <with-param name="end-sigil" select="'⸩'"/>
811 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:important"/>
813 <template match="node()" mode="LesML:important">
814 <variable name="result">
815 <apply-templates select="." mode="LesML:inline">
816 <with-param name="element-name" select="'html:strong'"/>
817 <with-param name="start-sigil" select="'☞'"/>
818 <with-param name="end-sigil" select="'☜'"/>
821 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:emphasized"/>
823 <template match="node()" mode="LesML:emphasized">
824 <variable name="result">
825 <apply-templates select="." mode="LesML:inline">
826 <with-param name="element-name" select="'html:em'"/>
827 <with-param name="start-sigil" select="'⹐'"/>
828 <with-param name="end-sigil" select="'⹑'"/>
831 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:titled"/>
833 <template match="node()" mode="LesML:titled">
834 <variable name="result">
835 <apply-templates select="." mode="LesML:inline">
836 <with-param name="element-name" select="'html:cite'"/>
837 <with-param name="start-sigil" select="'⟪'"/>
838 <with-param name="end-sigil" select="'⟫'"/>
841 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:offset"/>
843 <template match="node()" mode="LesML:offset">
844 <variable name="result">
845 <apply-templates select="." mode="LesML:inline">
846 <with-param name="element-name" select="'html:i'"/>
847 <with-param name="start-sigil" select="'⟨'"/>
848 <with-param name="end-sigil" select="'⟩'"/>
849 <with-param name="langtag-supported" select="true()"/>
852 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:bolded"/>
854 <template match="node()" mode="LesML:bolded">
855 <variable name="result">
856 <apply-templates select="." mode="LesML:inline">
857 <with-param name="element-name" select="'html:b'"/>
858 <with-param name="start-sigil" select="'⦃'"/>
859 <with-param name="end-sigil" select="'⦄'"/>
862 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:code"/>
864 <template match="node()" mode="LesML:code">
865 <apply-templates select="." mode="LesML:inline">
866 <with-param name="element-name" select="'html:code'"/>
867 <with-param name="start-sigil" select="'`'"/>
868 <with-param name="end-sigil" select="'´'"/>