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="source"/>
125 <param name="parent-params" select="/.."/>
126 <variable name="shebang">
127 <if test="starts-with($source, '#!lesml')">
128 <value-of select="substring-before($source, '
')"/>
131 <variable name="noshebang">
134 <when test="starts-with($source, '#!')">
135 <value-of select="substring-after($source, '
')"/>
138 <value-of select="$source"/>
142 <variable name="params-string">
144 <when test="starts-with($shebang, '#!lesml@')">
145 <value-of select="substring-after($shebang, '$')"/>
148 <value-of select="substring-after($shebang, '#!lesml')"/>
152 <variable name="params-fragment">
154 <if test="starts-with($shebang, '#!lesml@') and contains($shebang, '$')">
160 <value-of select="substring-before(substring-after($shebang, '#!lesml@'), '$')"/>
164 <for-each select="exslstr:tokenize($params-string)">
166 <when test="contains(., '=')">
169 <value-of select="substring-before(., '=')"/>
172 <value-of select="substring-after(., '=')"/>
179 <value-of select="."/>
188 <variable name="params" select="exsl:node-set($params-fragment)/*"/>
189 <variable name="records">
190 <call-template name="LesML:split">
191 <with-param name="source" select="$noshebang"/>
192 <with-param name="separator" select="'
%%'"/>
195 <variable name="record-nodes" select="exsl:node-set($records)/*"/>
197 <for-each select="$params/html:div/html:dt[string()=' LANG ']">
198 <attribute name="lang">
199 <value-of select="following-sibling::html:dd"/>
201 <attribute name="xml:lang">
202 <value-of select="following-sibling::html:dd"/>
205 <for-each select="$params/html:div/html:dt[string()='profile']">
206 <attribute name="data-lesml-profile">
207 <value-of select="following-sibling::html:dd"/>
210 <if test="count($record-nodes)>1">
211 <html:footer class="head">
212 <for-each select="$record-nodes[not(position()=last() or normalize-space(.)='')]">
213 <variable name="fields" select="exslstr:tokenize(., '
')"/>
215 <for-each select="$fields">
217 <when test="starts-with(., ' ') and $fields[generate-id()=generate-id(current()/preceding-sibling::*[1])]"/>
219 <variable name="next" select="following-sibling::*[not(starts-with(., ' '))]"/>
222 <value-of select="normalize-space(substring-before(., ':'))"/>
225 <variable name="firstline">
227 <when test="contains(., ':')">
228 <value-of select="normalize-space(substring-after(., ':'))"/>
231 <value-of select="normalize-space(.)"/>
236 <when test="substring($firstline, string-length($firstline))='\' and following-sibling::*[position()=1 and starts-with(., ' ')]">
237 <value-of select="substring($firstline, 1, string-length($firstline)-1)"/>
240 <value-of select="$firstline"/>
243 <for-each select="following-sibling::*[starts-with(., ' ') and not(preceding-sibling::*[generate-id()=generate-id($next)])]">
244 <variable name="nextline" select="normalize-space(.)"/>
246 <when test="substring($nextline, string-length($nextline))='\' and following-sibling::*[position()=1 and starts-with(., ' ')]">
247 <value-of select="substring($nextline, 1, string-length($nextline)-1)"/>
250 <value-of select="$nextline"/>
263 <html:div class="body">
264 <call-template name="LesML:paragraphize">
265 <with-param name="source" select="string($record-nodes[last()])"/>
270 <template name="LesML:paragraphize">
271 <param name="source"/>
272 <variable name="paragraphs">
273 <call-template name="LesML:split">
274 <with-param name="source" select="$source"/>
275 <with-param name="separator" select="'

'"/>
278 <variable name="blocked">
279 <for-each select="exsl:node-set($paragraphs)/*">
280 <variable name="lines">
281 <call-template name="LesML:split">
282 <with-param name="source" select="string()"/>
285 <variable name="linespans" select="exsl:node-set($lines)/*"/>
286 <variable name="quoted" select="not($linespans[not(starts-with(., ' ') or starts-with(., '	'))])"/>
287 <variable name="text">
288 <for-each select="$linespans">
289 <if test="normalize-space()!=''">
290 <value-of select="normalize-space()"/>
291 <if test="following-sibling::*[normalize-space()!='']">
297 <if test="string($text)!=''">
298 <variable name="par">
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, '§ ')">
309 <call-template name="LesML:id-and-contents">
310 <with-param name="source" select="substring-after($text, '§ ')"/>
314 <when test="starts-with($text, '❦ ')">
316 <call-template name="LesML:id-and-contents">
317 <with-param name="source" select="substring-after($text, '❦ ')"/>
321 <when test="starts-with($text, '✠ ')">
323 <call-template name="LesML:id-and-contents">
324 <with-param name="source" select="substring-after($text, '✠ ')"/>
328 <when test="starts-with($text, '• ')">
329 <html:li class="unordered" data-level="1">
331 <call-template name="LesML:id-and-contents">
332 <with-param name="source" select="substring-after($text, '• ')"/>
337 <when test="starts-with($text, '🔢 ')">
338 <html:li class="ordered" 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="unordered" data-level="2">
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="ordered" 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="unordered" data-level="3">
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="ordered" 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="unordered" data-level="4">
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="ordered" 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:div role="note" class="info">
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="query">
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="warn">
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="note">
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="caution">
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 class="continuation">
448 <call-template name="LesML:id-and-contents">
449 <with-param name="source" select="substring-after($text, '⋯ ')"/>
456 <call-template name="LesML:id-and-contents">
457 <with-param name="source" select="$text"/>
464 <when test="translate(string($text), '§ion-break; ', '')=''">
467 <when test="$quoted">
469 <copy-of select="$par"/>
473 <copy-of select="$par"/>
479 <variable name="inlined">
480 <apply-templates select="exsl:node-set($blocked)/node()" mode="LesML:linkify"/>
482 <apply-templates select="exsl:node-set($inlined)/node()" mode="LesML:finalize-tree"/>
484 <template match="html:script[@type='text/lesml']">
485 <variable name="source">
486 <for-each select=".//text()">
487 <value-of select="."/>
490 <call-template name="LesML:parse">
491 <with-param name="source" select="string($source)"/>
494 <template match="@*|node()" mode="LesML:finalize-tree" priority="-1">
496 <apply-templates select="@*|node()" mode="LesML:finalize-tree"/>
499 <template match="text()" mode="LesML:finalize-tree">
500 <call-template name="LesML:unescape">
501 <with-param name="source" select="string(.)"/>
504 <template match="html:blockquote" mode="LesML:finalize-tree">
505 <if test="not(preceding-sibling::node()) or preceding-sibling::node()[position()=1 and not(self::html:blockquote)]">
506 <variable name="notquote" select="following-sibling::node()[not(self::html:blockquote)][1]"/>
507 <variable name="contents">
508 <copy-of select="node()"/>
509 <for-each select="following-sibling::node()[not($notquote) or following-sibling::node()[generate-id()=generate-id($notquote)]]">
510 <copy-of select="node()"/>
513 <variable name="content-nodes" select="exsl:node-set($contents)/node()"/>
514 <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()]"/>
516 <when test="starts-with($laststarttext, '— ')">
517 <variable name="caption">
518 <copy-of select="$laststarttext/preceding-sibling::node()"/>
519 <value-of select="substring-after($laststarttext, '— ')"/>
520 <copy-of select="$laststarttext/following-sibling::node()"/>
524 <apply-templates select="@*|$content-nodes[position()!=last()]" mode="LesML:finalize-tree"/>
527 <for-each select="$content-nodes[last()]">
529 <apply-templates select="@*|exsl:node-set($caption)/node()" mode="LesML:finalize-tree"/>
537 <apply-templates select="@*|$content-nodes" mode="LesML:finalize-tree"/>
543 <template match="html:div" mode="LesML:finalize-tree">
544 <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)]">
545 <variable name="notcontinuation" select="following-sibling::node()[not(self::html:div and @class='continuation')][1]"/>
547 <apply-templates select="@*|node()" mode="LesML:finalize-tree"/>
548 <for-each select="following-sibling::node()[not($notcontinuation) or following-sibling::node()[generate-id()=generate-id($notcontinuation)]]">
549 <apply-templates select="node()" mode="LesML:finalize-tree"/>
554 <template match="html:li" mode="LesML:finalize-tree">
555 <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)]">
556 <apply-templates select="." mode="LesML:finalize-list"/>
559 <template match="html:li" mode="LesML:finalize-list">
560 <param name="parent-level" select="0"/>
561 <variable name="current-class" select="string(@class)"/>
562 <variable name="current-level" select="number(@data-level)"/>
563 <variable name="wrapper">
565 <when test="@class='ordered'">
573 <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]"/>
574 <element name="html:{$wrapper}" namespace="http://www.w3.org/1999/xhtml">
575 <for-each select=".|following-sibling::html:li[@data-level=$current-level and (not($notinlist) or following-sibling::node()[generate-id()=generate-id($notinlist)])]">
576 <variable name="notcontinuation" select="following-sibling::node()[not(self::html:div and @class='continuation')][1]"/>
578 <apply-templates select="@*|node()" mode="LesML:finalize-tree"/>
579 <for-each select="following-sibling::node()[not($notcontinuation) or following-sibling::node()[generate-id()=generate-id($notcontinuation)]]">
580 <apply-templates select="node()" mode="LesML:finalize-tree"/>
582 <if test="$notcontinuation/self::html:li[@data-level>$current-level]">
583 <apply-templates select="$notcontinuation" mode="LesML:finalize-list">
584 <with-param name="parent-level" select="$current-level"/>
590 <if test="$notinlist/self::html:li[@data-level>$parent-level]">
591 <apply-templates select="$notinlist" mode="LesML:finalize-list">
592 <with-param name="parent-level" select="$parent-level"/>
596 <template match="node()" mode="LesML:inline">
597 <param name="element-name"/>
598 <param name="element-namespace" select="'http://www.w3.org/1999/xhtml'"/>
599 <param name="start-sigil"/>
600 <param name="end-sigil"/>
602 <param name="langtag-supported" select="false()"/>
604 <when test="self::*">
606 <copy-of select="@*"/>
607 <variable name="start-node" select="text()[contains(., $start-sigil)][1]"/>
609 <when test="$start-node">
610 <variable name="remaining">
611 <value-of select="substring-after($start-node, $start-sigil)"/>
612 <copy-of select="$start-node/following-sibling::node()"/>
614 <variable name="end-node" select="exsl:node-set($remaining)/node()[self::text() and contains(., $end-sigil)][1]"/>
616 <when test="$end-node">
617 <variable name="restoftext" select="substring-after($end-node, $end-sigil)"/>
618 <variable name="maybe-langtag">
619 <if test="$langtag-supported and starts-with($restoftext, '@') and contains($restoftext, '$')">
620 <value-of select="substring-before(substring-after($restoftext, '@'), '$')"/>
623 <variable name="langtag">
624 <if test="translate($maybe-langtag, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-', '')=''">
625 <value-of select="$maybe-langtag"/>
628 <variable name="rest">
631 <when test="string($langtag)!=''">
632 <value-of select="substring-after($restoftext, '$')"/>
635 <value-of select="$restoftext"/>
638 <copy-of select="$end-node/following-sibling::node()"/>
641 <variable name="processed-rest">
642 <apply-templates select="exsl:node-set($rest)/*" mode="LesML:inline">
643 <with-param name="element-name" select="$element-name"/>
644 <with-param name="element-namespace" select="$element-namespace"/>
645 <with-param name="start-sigil" select="$start-sigil"/>
646 <with-param name="end-sigil" select="$end-sigil"/>
647 <with-param name="role" select="$role"/>
648 <with-param name="langtag-supported" select="$langtag-supported"/>
651 <copy-of select="$start-node/preceding-sibling::node()"/>
652 <value-of select="substring-before($start-node, $start-sigil)"/>
653 <element name="{$element-name}" namespace="{$element-namespace}">
654 <if test="string($role)!=''">
655 <attribute name="role">
656 <value-of select="$role"/>
659 <if test="string($langtag)!=''">
660 <if test="$element-namespace='http://www.w3.org/1999/xhtml'">
661 <attribute name="lang">
662 <value-of select="$langtag"/>
665 <attribute name="xml:lang">
666 <value-of select="$langtag"/>
669 <copy-of select="$end-node/preceding-sibling::node()"/>
670 <value-of select="substring-before($end-node, $end-sigil)"/>
672 <copy-of select="exsl:node-set($processed-rest)/*/node()"/>
675 <apply-templates select="node()" mode="LesML:inline">
676 <with-param name="element-name" select="$element-name"/>
677 <with-param name="element-namespace" select="$element-namespace"/>
678 <with-param name="start-sigil" select="$start-sigil"/>
679 <with-param name="end-sigil" select="$end-sigil"/>
680 <with-param name="role" select="$role"/>
681 <with-param name="langtag-supported" select="$langtag-supported"/>
687 <apply-templates select="node()" mode="LesML:inline">
688 <with-param name="element-name" select="$element-name"/>
689 <with-param name="element-namespace" select="$element-namespace"/>
690 <with-param name="start-sigil" select="$start-sigil"/>
691 <with-param name="end-sigil" select="$end-sigil"/>
692 <with-param name="role" select="$role"/>
693 <with-param name="langtag-supported" select="$langtag-supported"/>
700 <copy-of select="."/>
704 <template match="node()" mode="LesML:linkify">
705 <variable name="result">
707 <when test="self::*">
709 <copy-of select="@*"/>
710 <variable name="start-node" select="text()[contains(., '{🔗')][1]"/>
712 <when test="$start-node">
713 <variable name="remaining">
714 <value-of select="substring-after($start-node, '{🔗')"/>
715 <copy-of select="$start-node/following-sibling::node()"/>
717 <variable name="end-node" select="exsl:node-set($remaining)/node()[self::text() and contains(., '>}') and not(preceding-sibling::*)][1]"/>
718 <variable name="hyperlink">
719 <for-each select="$end-node/preceding-sibling::node()">
720 <value-of select="."/>
722 <value-of select="substring-before($end-node, '>}')"/>
725 <when test="contains($hyperlink, '<')">
726 <variable name="ltcomponents">
727 <call-template name="LesML:split">
728 <with-param name="source" select="$hyperlink"/>
729 <with-param name="separator" select="'<'"/>
732 <variable name="ltcomponent-nodes" select="exsl:node-set($ltcomponents)/*"/>
733 <variable name="rest">
735 <value-of select="substring-after($end-node, '>}')"/>
736 <copy-of select="$end-node/following-sibling::node()"/>
739 <variable name="processed-rest">
740 <apply-templates select="exsl:node-set($rest)/*" mode="LesML:linkify"/>
742 <copy-of select="$start-node/preceding-sibling::node()"/>
743 <value-of select="substring-before($start-node, '{🔗')"/>
744 <html:a href="{$ltcomponent-nodes[last()]}">
746 <when test="count($ltcomponent-nodes)>2 or normalize-space($ltcomponent-nodes[1])!=''">
747 <value-of select="$ltcomponent-nodes[1]"/>
748 <for-each select="$ltcomponent-nodes[position()>1 and position()!=last()]">
750 <value-of select="."/>
754 <value-of select="$ltcomponent-nodes[last()]"/>
758 <copy-of select="exsl:node-set($processed-rest)/*/node()"/>
761 <variable name="rest">
763 <copy-of select="$remaining"/>
766 <variable name="processed-rest">
767 <apply-templates select="exsl:node-set($rest)/*" mode="LesML:linkify"/>
769 <copy-of select="$start-node/preceding-sibling::node()"/>
770 <value-of select="substring-before($start-node, '{🔗')"/>
772 <copy-of select="exsl:node-set($processed-rest)/*/node()"/>
777 <apply-templates select="node()" mode="LesML:linkify"/>
783 <copy-of select="."/>
787 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:strikethrough"/>
789 <template match="node()" mode="LesML:strikethrough">
790 <variable name="result">
791 <apply-templates select="." mode="LesML:inline">
792 <with-param name="element-name" select="'html:s'"/>
793 <with-param name="start-sigil" select="'⸠'"/>
794 <with-param name="end-sigil" select="'⸡'"/>
797 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:underline"/>
799 <template match="node()" mode="LesML:underline">
800 <variable name="result">
801 <apply-templates select="." mode="LesML:inline">
802 <with-param name="element-name" select="'html:u'"/>
803 <with-param name="start-sigil" select="'⸤'"/>
804 <with-param name="end-sigil" select="'⸥'"/>
807 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:noted"/>
809 <template match="node()" mode="LesML:noted">
810 <variable name="result">
811 <apply-templates select="." mode="LesML:inline">
812 <with-param name="element-name" select="'html:small'"/>
813 <with-param name="start-sigil" select="'⟦'"/>
814 <with-param name="end-sigil" select="'⟧'"/>
815 <with-param name="role" select="'note'"/>
818 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:parenthetical"/>
820 <template match="node()" mode="LesML:parenthetical">
821 <variable name="result">
822 <apply-templates select="." mode="LesML:inline">
823 <with-param name="element-name" select="'html:small'"/>
824 <with-param name="start-sigil" select="'⸨'"/>
825 <with-param name="end-sigil" select="'⸩'"/>
828 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:important"/>
830 <template match="node()" mode="LesML:important">
831 <variable name="result">
832 <apply-templates select="." mode="LesML:inline">
833 <with-param name="element-name" select="'html:strong'"/>
834 <with-param name="start-sigil" select="'☞'"/>
835 <with-param name="end-sigil" select="'☜'"/>
838 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:emphasized"/>
840 <template match="node()" mode="LesML:emphasized">
841 <variable name="result">
842 <apply-templates select="." mode="LesML:inline">
843 <with-param name="element-name" select="'html:em'"/>
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:titled"/>
850 <template match="node()" mode="LesML:titled">
851 <variable name="result">
852 <apply-templates select="." mode="LesML:inline">
853 <with-param name="element-name" select="'html:cite'"/>
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:offset"/>
860 <template match="node()" mode="LesML:offset">
861 <variable name="result">
862 <apply-templates select="." mode="LesML:inline">
863 <with-param name="element-name" select="'html:i'"/>
864 <with-param name="start-sigil" select="'⟨'"/>
865 <with-param name="end-sigil" select="'⟩'"/>
866 <with-param name="langtag-supported" select="true()"/>
869 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:bolded"/>
871 <template match="node()" mode="LesML:bolded">
872 <variable name="result">
873 <apply-templates select="." mode="LesML:inline">
874 <with-param name="element-name" select="'html:b'"/>
875 <with-param name="start-sigil" select="'⦃'"/>
876 <with-param name="end-sigil" select="'⦄'"/>
879 <apply-templates select="exsl:node-set($result)/node()" mode="LesML:code"/>
881 <template match="node()" mode="LesML:code">
882 <apply-templates select="." mode="LesML:inline">
883 <with-param name="element-name" select="'html:code'"/>
884 <with-param name="start-sigil" select="'`'"/>
885 <with-param name="end-sigil" select="'´'"/>