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="$shebang!='' or $doclines[normalize-space()!='']">
193 <variable name="record-separators" select="$doclines[starts-with(., '%%')]"/>
195 <for-each select="$params/html:div/html:dt[string()=' LANG ']">
196 <attribute name="lang">
197 <value-of select="following-sibling::html:dd"/>
199 <attribute name="xml:lang">
200 <value-of select="following-sibling::html:dd"/>
203 <for-each select="$params/html:div/html:dt[string()='profile']">
204 <attribute name="data-lesml-profile">
205 <value-of select="following-sibling::html:dd"/>
208 <if test="$record-separators[preceding-sibling::*[normalize-space()!='']]">
209 <html:footer class="head">
210 <for-each select="$record-separators">
211 <variable name="position" select="position()"/>
212 <variable name="prev-separator" select="$record-separators[($position)-1]"/>
213 <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)])]"/>
216 <for-each select="$fields">
218 <when test="starts-with(., ' ') and $fields[generate-id()=generate-id(current()/preceding-sibling::*[1])]"/>
220 <variable name="next" select="following-sibling::*[not(starts-with(., ' '))]"/>
223 <value-of select="normalize-space(substring-before(., ':'))"/>
226 <variable name="firstline">
228 <when test="contains(., ':')">
229 <value-of select="normalize-space(substring-after(., ':'))"/>
232 <value-of select="normalize-space(.)"/>
237 <when test="substring($firstline, string-length($firstline))='\' and following-sibling::*[position()=1 and starts-with(., ' ')]">
238 <value-of select="substring($firstline, 1, string-length($firstline)-1)"/>
241 <value-of select="$firstline"/>
244 <for-each select="following-sibling::*[starts-with(., ' ') and not(preceding-sibling::*[generate-id()=generate-id($next)])]">
245 <variable name="nextline" select="normalize-space(.)"/>
247 <when test="substring($nextline, string-length($nextline))='\' and following-sibling::*[position()=1 and starts-with(., ' ')]">
248 <value-of select="substring($nextline, 1, string-length($nextline)-1)"/>
251 <value-of select="$nextline"/>
265 <html:div class="body">
266 <call-template name="LesML:paragraphize">
267 <with-param name="lines" select="$doclines[not($record-separators) or preceding-sibling::*[generate-id()=generate-id($record-separators[last()])]]"/>
273 <call-template name="LesML:parse">
274 <with-param name="lines" select="$docsep|$lines[preceding-sibling::*[generate-id()=generate-id($docsep)]]"/>
275 <with-param name="parent-params" select="$params"/>
279 <template name="LesML:paragraphize">
280 <param name="lines" select="/.."/>
281 <variable name="last-lines" select="$lines[normalize-space()!='' and normalize-space(following-sibling::*[1])='']|$lines[last()]"/>
282 <variable name="blocked">
283 <for-each select="$last-lines">
284 <variable name="position" select="position()"/>
285 <variable name="prev-last" select="$last-lines[($position)-1]"/>
286 <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()!='']|."/>
287 <variable name="quoted" select="not($linespans[not(starts-with(., ' ') or starts-with(., '	'))])"/>
288 <variable name="text">
289 <for-each select="$linespans">
290 <value-of select="normalize-space()"/>
291 <if test="position()!=count($linespans)">
296 <if test="string($text)!=''">
297 <variable name="par">
299 <when test="starts-with($text, '⁌ ')">
301 <call-template name="LesML:id-and-contents">
302 <with-param name="source" select="substring-after($text, '⁌ ')"/>
306 <when test="starts-with($text, '§ ')">
308 <call-template name="LesML:id-and-contents">
309 <with-param name="source" select="substring-after($text, '§ ')"/>
313 <when test="starts-with($text, '❦ ')">
315 <call-template name="LesML:id-and-contents">
316 <with-param name="source" select="substring-after($text, '❦ ')"/>
320 <when test="starts-with($text, '✠ ')">
322 <call-template name="LesML:id-and-contents">
323 <with-param name="source" select="substring-after($text, '✠ ')"/>
327 <when test="starts-with($text, '• ')">
328 <html:li class="unordered" data-level="1">
330 <call-template name="LesML:id-and-contents">
331 <with-param name="source" select="substring-after($text, '• ')"/>
336 <when test="starts-with($text, '🔢 ')">
337 <html:li class="ordered" data-level="1">
339 <call-template name="LesML:id-and-contents">
340 <with-param name="source" select="substring-after($text, '🔢 ')"/>
345 <when test="starts-with($text, '◦ ')">
346 <html:li class="unordered" data-level="2">
348 <call-template name="LesML:id-and-contents">
349 <with-param name="source" select="substring-after($text, '◦ ')"/>
354 <when test="starts-with($text, '🔠 ')">
355 <html:li class="ordered" data-level="2">
357 <call-template name="LesML:id-and-contents">
358 <with-param name="source" select="substring-after($text, '🔠 ')"/>
363 <when test="starts-with($text, '▪ ')">
364 <html:li class="unordered" data-level="3">
366 <call-template name="LesML:id-and-contents">
367 <with-param name="source" select="substring-after($text, '▪ ')"/>
372 <when test="starts-with($text, '🔡 ')">
373 <html:li class="ordered" data-level="3">
375 <call-template name="LesML:id-and-contents">
376 <with-param name="source" select="substring-after($text, '🔡 ')"/>
381 <when test="starts-with($text, '⁃ ')">
382 <html:li class="unordered" data-level="4">
384 <call-template name="LesML:id-and-contents">
385 <with-param name="source" select="substring-after($text, '⁃ ')"/>
390 <when test="starts-with($text, '🔣 ')">
391 <html:li class="ordered" data-level="4">
393 <call-template name="LesML:id-and-contents">
394 <with-param name="source" select="substring-after($text, '🔣 ')"/>
399 <when test="starts-with($text, '🛈 ')">
400 <html:div role="note" class="info">
402 <call-template name="LesML:id-and-contents">
403 <with-param name="source" select="substring-after($text, '🛈 ')"/>
408 <when test="starts-with($text, '⯑ ')">
409 <html:div role="note" class="query">
411 <call-template name="LesML:id-and-contents">
412 <with-param name="source" select="substring-after($text, '⯑ ')"/>
417 <when test="starts-with($text, '⚠︎ ')">
418 <html:div role="note" class="warn">
420 <call-template name="LesML:id-and-contents">
421 <with-param name="source" select="substring-after($text, '⚠︎ ')"/>
426 <when test="starts-with($text, '※ ')">
427 <html:div role="note" class="note">
429 <call-template name="LesML:id-and-contents">
430 <with-param name="source" select="substring-after($text, '※ ')"/>
435 <when test="starts-with($text, '☡ ')">
436 <html:div role="note" class="caution">
438 <call-template name="LesML:id-and-contents">
439 <with-param name="source" select="substring-after($text, '☡ ')"/>
444 <when test="starts-with($text, '⋯ ')">
445 <html:div class="continuation">
447 <call-template name="LesML:id-and-contents">
448 <with-param name="source" select="substring-after($text, '⋯ ')"/>
455 <call-template name="LesML:id-and-contents">
456 <with-param name="source" select="$text"/>
463 <when test="translate(string($text), '§ion-break; ', '')=''">
466 <when test="$quoted">
468 <copy-of select="$par"/>
472 <copy-of select="$par"/>
478 <variable name="inlined">
479 <apply-templates select="exsl:node-set($blocked)/node()" mode="LesML:linkify"/>
481 <apply-templates select="exsl:node-set($inlined)/node()" mode="LesML:finalize-tree"/>
483 <template match="html:script[@type='text/lesml']">
484 <variable name="lines-fragment">
485 <call-template name="LesML:split">
486 <with-param name="source">
487 <for-each select=".//text()">
488 <value-of select="."/>
493 <call-template name="LesML:parse">
494 <with-param name="lines" select="exsl:node-set($lines-fragment)/*"/>
497 <template match="@*|node()" mode="LesML:finalize-tree" priority="-1">
499 <apply-templates select="@*|node()" mode="LesML:finalize-tree"/>
502 <template match="text()" mode="LesML:finalize-tree">
503 <call-template name="LesML:unescape">
504 <with-param name="source" select="string(.)"/>
507 <template match="html:blockquote" mode="LesML:finalize-tree">
508 <if test="not(preceding-sibling::node()) or preceding-sibling::node()[position()=1 and not(self::html:blockquote)]">
509 <variable name="notquote" select="following-sibling::node()[not(self::html:blockquote)][1]"/>
510 <variable name="contents">
511 <copy-of select="node()"/>
512 <for-each select="following-sibling::node()[not($notquote) or following-sibling::node()[generate-id()=generate-id($notquote)]]">
513 <copy-of select="node()"/>
516 <variable name="content-nodes" select="exsl:node-set($contents)/node()"/>
517 <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()]"/>
519 <when test="starts-with($laststarttext, '— ')">
520 <variable name="caption">
521 <copy-of select="$laststarttext/preceding-sibling::node()"/>
522 <value-of select="substring-after($laststarttext, '— ')"/>
523 <copy-of select="$laststarttext/following-sibling::node()"/>
527 <apply-templates select="@*|$content-nodes[position()!=last()]" mode="LesML:finalize-tree"/>
530 <for-each select="$content-nodes[last()]">
532 <apply-templates select="@*|exsl:node-set($caption)/node()" mode="LesML:finalize-tree"/>
540 <apply-templates select="@*|$content-nodes" mode="LesML:finalize-tree"/>
546 <template match="html:div" mode="LesML:finalize-tree">
547 <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)]">
548 <variable name="notcontinuation" select="following-sibling::node()[not(self::html:div and @class='continuation')][1]"/>
550 <apply-templates select="@*|node()" mode="LesML:finalize-tree"/>
551 <for-each select="following-sibling::node()[not($notcontinuation) or following-sibling::node()[generate-id()=generate-id($notcontinuation)]]">
552 <apply-templates select="node()" mode="LesML:finalize-tree"/>
557 <template match="html:li" mode="LesML:finalize-tree">
558 <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)]">
559 <apply-templates select="." mode="LesML:finalize-list"/>
562 <template match="html:li" mode="LesML:finalize-list">
563 <param name="parent-level" select="0"/>
564 <variable name="current-class" select="string(@class)"/>
565 <variable name="current-level" select="number(@data-level)"/>
566 <variable name="wrapper">
568 <when test="@class='ordered'">
576 <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]"/>
577 <element name="html:{$wrapper}" namespace="http://www.w3.org/1999/xhtml">
578 <for-each select=".|following-sibling::html:li[@data-level=$current-level and (not($notinlist) or following-sibling::node()[generate-id()=generate-id($notinlist)])]">
579 <variable name="notcontinuation" select="following-sibling::node()[not(self::html:div and @class='continuation')][1]"/>
581 <apply-templates select="@*|node()" mode="LesML:finalize-tree"/>
582 <for-each select="following-sibling::node()[not($notcontinuation) or following-sibling::node()[generate-id()=generate-id($notcontinuation)]]">
583 <apply-templates select="node()" mode="LesML:finalize-tree"/>
585 <if test="$notcontinuation/self::html:li[@data-level>$current-level]">
586 <apply-templates select="$notcontinuation" mode="LesML:finalize-list">
587 <with-param name="parent-level" select="$current-level"/>
593 <if test="$notinlist/self::html:li[@data-level>$parent-level]">
594 <apply-templates select="$notinlist" mode="LesML:finalize-list">
595 <with-param name="parent-level" select="$parent-level"/>
599 <template match="node()" mode="LesML:inline">
600 <param name="element-name"/>
601 <param name="element-namespace" select="'http://www.w3.org/1999/xhtml'"/>
602 <param name="start-sigil"/>
603 <param name="end-sigil"/>
605 <param name="langtag-supported" select="false()"/>
607 <when test="self::*">
609 <copy-of select="@*"/>
610 <variable name="start-node" select="text()[contains(., $start-sigil)][1]"/>
612 <when test="$start-node">
613 <variable name="remaining">
614 <value-of select="substring-after($start-node, $start-sigil)"/>
615 <copy-of select="$start-node/following-sibling::node()"/>
617 <variable name="end-node" select="exsl:node-set($remaining)/node()[self::text() and contains(., $end-sigil)][1]"/>
619 <when test="$end-node">
620 <variable name="restoftext" select="substring-after($end-node, $end-sigil)"/>
621 <variable name="maybe-langtag">
622 <if test="$langtag-supported and starts-with($restoftext, '@') and contains($restoftext, '$')">
623 <value-of select="substring-before(substring-after($restoftext, '@'), '$')"/>
626 <variable name="langtag">
627 <if test="translate($maybe-langtag, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-', '')=''">
628 <value-of select="$maybe-langtag"/>
631 <variable name="rest">
634 <when test="string($langtag)!=''">
635 <value-of select="substring-after($restoftext, '$')"/>
638 <value-of select="$restoftext"/>
641 <copy-of select="$end-node/following-sibling::node()"/>
644 <variable name="processed-rest">
645 <apply-templates select="exsl:node-set($rest)/*" mode="LesML:inline">
646 <with-param name="element-name" select="$element-name"/>
647 <with-param name="element-namespace" select="$element-namespace"/>
648 <with-param name="start-sigil" select="$start-sigil"/>
649 <with-param name="end-sigil" select="$end-sigil"/>
650 <with-param name="role" select="$role"/>
651 <with-param name="langtag-supported" select="$langtag-supported"/>
654 <copy-of select="$start-node/preceding-sibling::node()"/>
655 <value-of select="substring-before($start-node, $start-sigil)"/>
656 <element name="{$element-name}" namespace="{$element-namespace}">
657 <if test="string($role)!=''">
658 <attribute name="role">
659 <value-of select="$role"/>
662 <if test="string($langtag)!=''">
663 <if test="$element-namespace='http://www.w3.org/1999/xhtml'">
664 <attribute name="lang">
665 <value-of select="$langtag"/>
668 <attribute name="xml:lang">
669 <value-of select="$langtag"/>
672 <copy-of select="$end-node/preceding-sibling::node()"/>
673 <value-of select="substring-before($end-node, $end-sigil)"/>
675 <copy-of select="exsl:node-set($processed-rest)/*/node()"/>
678 <apply-templates select="node()" mode="LesML:inline">
679 <with-param name="element-name" select="$element-name"/>
680 <with-param name="element-namespace" select="$element-namespace"/>
681 <with-param name="start-sigil" select="$start-sigil"/>
682 <with-param name="end-sigil" select="$end-sigil"/>
683 <with-param name="role" select="$role"/>
684 <with-param name="langtag-supported" select="$langtag-supported"/>
690 <apply-templates select="node()" mode="LesML:inline">
691 <with-param name="element-name" select="$element-name"/>
692 <with-param name="element-namespace" select="$element-namespace"/>
693 <with-param name="start-sigil" select="$start-sigil"/>
694 <with-param name="end-sigil" select="$end-sigil"/>
695 <with-param name="role" select="$role"/>
696 <with-param name="langtag-supported" select="$langtag-supported"/>
703 <copy-of select="."/>
707 <template match="node()" mode="LesML:linkify">
708 <variable name="result">
710 <when test="self::*">
712 <copy-of select="@*"/>
713 <variable name="start-node" select="text()[contains(., '{🔗')][1]"/>
715 <when test="$start-node">
716 <variable name="remaining">
717 <value-of select="substring-after($start-node, '{🔗')"/>
718 <copy-of select="$start-node/following-sibling::node()"/>
720 <variable name="end-node" select="exsl:node-set($remaining)/node()[self::text() and contains(., '>}') and not(preceding-sibling::*)][1]"/>
721 <variable name="hyperlink">
722 <for-each select="$end-node/preceding-sibling::node()">
723 <value-of select="."/>
725 <value-of select="substring-before($end-node, '>}')"/>
728 <when test="contains($hyperlink, '<')">
729 <variable name="ltcomponents">
730 <call-template name="LesML:split">
731 <with-param name="source" select="$hyperlink"/>
732 <with-param name="separator" select="'<'"/>
735 <variable name="ltcomponent-nodes" select="exsl:node-set($ltcomponents)/*"/>
736 <variable name="rest">
738 <value-of select="substring-after($end-node, '>}')"/>
739 <copy-of select="$end-node/following-sibling::node()"/>
742 <variable name="processed-rest">
743 <apply-templates select="exsl:node-set($rest)/*" mode="LesML:linkify"/>
745 <copy-of select="$start-node/preceding-sibling::node()"/>
746 <value-of select="substring-before($start-node, '{🔗')"/>
747 <html:a href="{$ltcomponent-nodes[last()]}">
749 <when test="count($ltcomponent-nodes)>2 or normalize-space($ltcomponent-nodes[1])!=''">
750 <value-of select="$ltcomponent-nodes[1]"/>
751 <for-each select="$ltcomponent-nodes[position()>1 and position()!=last()]">
753 <value-of select="."/>
757 <value-of select="$ltcomponent-nodes[last()]"/>
761 <copy-of select="exsl:node-set($processed-rest)/*/node()"/>
764 <variable name="rest">
766 <copy-of select="$remaining"/>
769 <variable name="processed-rest">
770 <apply-templates select="exsl:node-set($rest)/*" mode="LesML:linkify"/>
772 <copy-of select="$start-node/preceding-sibling::node()"/>
773 <value-of select="substring-before($start-node, '{🔗')"/>
775 <copy-of select="exsl:node-set($processed-rest)/*/node()"/>
780 <apply-templates select="node()" mode="LesML:linkify"/>
786 <copy-of select="."/>
790 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:strikethrough"/>
792 <template match="node()" mode="LesML:strikethrough">
793 <variable name="result">
794 <apply-templates select="." mode="LesML:inline">
795 <with-param name="element-name" select="'html:s'"/>
796 <with-param name="start-sigil" select="'⸠'"/>
797 <with-param name="end-sigil" select="'⸡'"/>
800 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:underline"/>
802 <template match="node()" mode="LesML:underline">
803 <variable name="result">
804 <apply-templates select="." mode="LesML:inline">
805 <with-param name="element-name" select="'html:u'"/>
806 <with-param name="start-sigil" select="'⸤'"/>
807 <with-param name="end-sigil" select="'⸥'"/>
810 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:noted"/>
812 <template match="node()" mode="LesML:noted">
813 <variable name="result">
814 <apply-templates select="." mode="LesML:inline">
815 <with-param name="element-name" select="'html:small'"/>
816 <with-param name="start-sigil" select="'⟦'"/>
817 <with-param name="end-sigil" select="'⟧'"/>
818 <with-param name="role" select="'note'"/>
821 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:parenthetical"/>
823 <template match="node()" mode="LesML:parenthetical">
824 <variable name="result">
825 <apply-templates select="." mode="LesML:inline">
826 <with-param name="element-name" select="'html:small'"/>
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:important"/>
833 <template match="node()" mode="LesML:important">
834 <variable name="result">
835 <apply-templates select="." mode="LesML:inline">
836 <with-param name="element-name" select="'html:strong'"/>
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:emphasized"/>
843 <template match="node()" mode="LesML:emphasized">
844 <variable name="result">
845 <apply-templates select="." mode="LesML:inline">
846 <with-param name="element-name" select="'html:em'"/>
847 <with-param name="start-sigil" select="'⹐'"/>
848 <with-param name="end-sigil" select="'⹑'"/>
851 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:titled"/>
853 <template match="node()" mode="LesML:titled">
854 <variable name="result">
855 <apply-templates select="." mode="LesML:inline">
856 <with-param name="element-name" select="'html:cite'"/>
857 <with-param name="start-sigil" select="'⟪'"/>
858 <with-param name="end-sigil" select="'⟫'"/>
861 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:offset"/>
863 <template match="node()" mode="LesML:offset">
864 <variable name="result">
865 <apply-templates select="." mode="LesML:inline">
866 <with-param name="element-name" select="'html:i'"/>
867 <with-param name="start-sigil" select="'⟨'"/>
868 <with-param name="end-sigil" select="'⟩'"/>
869 <with-param name="langtag-supported" select="true()"/>
872 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:bolded"/>
874 <template match="node()" mode="LesML:bolded">
875 <variable name="result">
876 <apply-templates select="." mode="LesML:inline">
877 <with-param name="element-name" select="'html:b'"/>
878 <with-param name="start-sigil" select="'⦃'"/>
879 <with-param name="end-sigil" select="'⦄'"/>
882 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:code"/>
884 <template match="node()" mode="LesML:code">
885 <apply-templates select="." mode="LesML:inline">
886 <with-param name="element-name" select="'html:code'"/>
887 <with-param name="start-sigil" select="'`'"/>
888 <with-param name="end-sigil" select="'´'"/>