]> Lady’s Gitweb - LesML/commitdiff
Quotes and brackets as multiparagraph divisions
authorLady <redacted>
Mon, 28 Apr 2025 00:42:16 +0000 (20:42 -0400)
committerLady <redacted>
Mon, 28 Apr 2025 01:13:05 +0000 (21:13 -0400)
This commit introduces a new concept of multiparagraph divisions (where
the lines within are re·analysed after the prefix is removed) and
transitions block quotations to it. I resisted this for a long while
because it’s less “simple”, but the precedent of preformatted text and
the old quotation mechanism (which was kind of messy) was already
conceptually close. And footer support really requires this.

README.markdown
parser.xslt

index 1979cd30517bf5bec7b8b027ed9a493c543038c8..1643af28f7db26d85b1471e309883924a17bd696 100644 (file)
@@ -52,6 +52,14 @@ Documents in the later case inherit the latest preceding `#!lesml`
 
 Documents are broken into paragraphs by blank lines.
 Empty paragraphs are ignored.
+
+If every line in the paragraph begins with (optional white·space
+  followed by) `»` it is quoted (`<html:blockquote>`); if every line
+  begins with `]` it is bracketed.
+The lines, minus this leading, are then re‐analysed.
+Bracketed paragraphs which end quotes are treated as captions
+  (`<html:figcaption>`); otherwise, they are footers (`<html:footer>`).
+
 Non·empty paragraphs are classified as follows :⁠—
 
 - If the paragraph consists of only the following section‐break
@@ -98,21 +106,16 @@ Non·empty paragraphs are classified as follows :⁠—
   | `_` | `U+FF3F` | `FULLWIDTH LOW LINE` |
   | `~` | `U+FF5E` | `FULLWIDTH TILDE` |
 
-- If every line in the paragraph begins with at least one space, then
-    it is considered to be a quoted paragraph (`<html:blockquote>`).
-  There is only one level of paragraph quoting; quoted paragraphs may
-    not be quoted again.
-
 - If every line in the paragraph begins with zero or more white·space
     characters followed by `|`, it is a “preformatted” paragraph and
     white·space is not collapsed (`<html:pre>`).
-  A paragraph may be both quoted and preformatted.
 
-- Otherwise, the paragraph is unquoted.
+- Otherwise, the paragraph is ordinary.
 
-After this classification, each quoted or unquoted paragraph is further
+After this classification, each ordinary paragraph is further
   classified by type based on its first character (which is must be
-   followed by white·space, or else the only thing on the line) :⁠—
+  followed by white·space, a pilcrow, or else the only thing on the
+  line) :⁠—
 
 - If the paragraph is preformatted, it is an ordinary paragraph.
 
@@ -172,10 +175,8 @@ After this classification, each quoted or unquoted paragraph is further
 
 - If the paragraph begins with `⋯`, it is a continuation paragraph
     (`<html:div class="continuation">`).
-  Continuation paragraphs may be used to continue a preceding list item
-    or quote.
-  Note, however, that an unquoted paragraph cannot continue a quoted
-    one, or vice·versa.
+  Continuation paragraphs may be used to continue a preceding div or
+    list item.
 
 - Otherwise, it is an ordinary paragraph.
 
@@ -202,7 +203,8 @@ Markup within paragraphs is delimited with·out exception by pairs of
     white·space‐only text nodes after elements ignored; if there is no
     such previous element or text node, an empty text node is used
     instead.
-  Multiple attributes can be given in sequence.
+  Multiple attributes can be given in sequence using multiple
+    specifications.
   Text nodes with attributes are wrapped in `<html:span>`.
 
 - The characters `{🔗` and `>}` indicate a hyperlink to a U·R·L
@@ -241,13 +243,8 @@ Markup within paragraphs is delimited with·out exception by pairs of
 Once the tree is built as above, it is remediated into its final form
   by the following steps :⁠—
 
-- Successive quoted paragraphs are joined into one quote.
-  If the final quoted paragraph is an ordinary paragraph which begins
-    with `—` and a space, the quote is wrapped in a `<html:figure>`
-    and the final paragraph becomes its `<html:figcaption>`.
-
 - Continuation paragraphs are joined with the preceding list items or
-    quotes.
+    divs.
 
 - List items of a higher level are nested in preceding list items, when
     present.
index 186e3896328a4d76f7259bb1a2f60815a1df3234..99ee7434f534aec464594df038b17656e7ccf157 100644 (file)
@@ -13,7 +13,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
 -->
 <!DOCTYPE transform [
        <!ENTITY LesML "urn:fdc:ladys.computer:20240512:LesML">
-       <!ENTITY section-break "*-.=_~·․‥…⁂⋯─━┄┅┈┉╌╍═╴╶╸╺☙❧ ・*-.=_~">
+       <!ENTITY section-break "">
        <!ENTITY sigiled-text "(string-length($text)=1 or substring($text, 2, 1)=' ' or substring($text, 2, 1)='¶')">
        <!ENTITY unsigiled-text "concat(translate(substring($text, 2, 1), ' ', ''), substring($text, 3, string-length($text)-2))">
        <!ENTITY xhtml "http://www.w3.org/1999/xhtml">
@@ -32,6 +32,7 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
        version="1.0"
 >
        <书社:id>urn:fdc:ladys.computer:20240512:LesML:parser.xslt</书社:id>
+       <param name="LESML_SECTION_BREAK_CHARS" select="'*-.=_~·․‥…⁂⋯─━┄┅┈┉╌╍═╴╶╸╺☙❧ ・*-.=_~'"/>
        <template name="LesML:split">
                <param name="source"/>
                <param name="separator" select="'&#xA;'"/>
@@ -384,317 +385,364 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                        </call-template>
                </if>
        </template>
-       <template name="LesML:paragraphize">
+       <template name="LesML:block">
                <param name="lines" select="/.."/>
-               <variable name="last-lines" select="$lines[normalize-space()!='' and normalize-space(following-sibling::*[1])='']|$lines[last()]"/>
-               <variable name="blocked">
-                       <for-each select="$last-lines">
-                               <variable name="position" select="position()"/>
-                               <variable name="prev-last" select="$last-lines[($position)-1]"/>
-                               <variable name="linespans" select="(exslset:intersection(exslset:trailing($lines, $prev-last), exslset:leading($lines, .))|.)[normalize-space()!='']"/>
-                               <variable name="quoted" select="not($linespans[not(starts-with(., ' ') or starts-with(., '&#x9;'))])"/>
-                               <variable name="preformatted" select="not($linespans[not(starts-with(normalize-space(), '|'))])"/>
-                               <variable name="text">
-                                       <for-each select="$linespans">
-                                               <choose>
-                                                       <when test="$preformatted">
-                                                               <value-of select="substring-after(., '|')"/>
-                                                       </when>
-                                                       <otherwise>
-                                                               <value-of select="normalize-space()"/>
-                                                       </otherwise>
-                                               </choose>
-                                               <if test="position()!=count($linespans)">
+               <variable name="last-lines" select="$lines[normalize-space()!='' and (normalize-space(following-sibling::*[1])='' or position()=last())]"/>
+               <for-each select="$last-lines">
+                       <variable name="position" select="position()"/>
+                       <variable name="prev-last" select="$last-lines[($position)-1]"/>
+                       <variable name="linespans" select="(exslset:intersection(exslset:trailing($lines, $prev-last), exslset:leading($lines, .))|.)[normalize-space()!='']"/>
+                       <variable name="prefix" select="substring(translate(., ' &#x9;', ''), 1, 1)"/>
+                       <variable name="all-prefixed" select="not($linespans[not(starts-with(translate(., ' &#x9;', ''), $prefix))])"/>
+                       <variable name="quoted" select="$all-prefixed and $prefix='»'"/>
+                       <variable name="bracketed" select="$all-prefixed and $prefix=']'"/>
+                       <choose>
+                               <when test="count($linespans)=1 and translate(., concat($LESML_SECTION_BREAK_CHARS, ' &#x9;'), '')=''">
+                                       <element name="hr" namespace="&xhtml;"/>
+                               </when>
+                               <when test="$quoted or $bracketed">
+                                       <variable name="innerlines-fragment">
+                                               <for-each select="$linespans">
+                                                       <variable name="inner">
+                                                               <value-of select="substring-after(., $prefix)"/>
+                                                       </variable>
+                                                       <copy>
+                                                               <choose>
+                                                                       <when test="starts-with($inner, ' ') or starts-with($inner, '&#x9;')">
+                                                                               <value-of select="substring($inner, 1+count(exslstr:tokenize($inner, '')[normalize-space()='' and not(preceding-sibling::*[normalize-space()!=''])]))"/>
+                                                                       </when>
+                                                                       <otherwise>
+                                                                               <value-of select="$inner"/>
+                                                                       </otherwise>
+                                                               </choose>
+                                                       </copy>
+                                               </for-each>
+                                       </variable>
+                                       <variable name="blocked-fragment">
+                                               <call-template name="LesML:block">
+                                                       <with-param name="lines" select="exsl:node-set($innerlines-fragment)/*"/>
+                                               </call-template>
+                                       </variable>
+                                       <variable name="innerpars" select="exsl:node-set($blocked-fragment)/node()"/>
+                                       <choose>
+                                               <when test="$quoted and $innerpars[position()=last() and self::html:footer]">
+                                                       <element name="figure" namespace="&xhtml;">
+                                                               <element name="blockquote" namespace="&xhtml;">
+                                                                       <copy-of select="$innerpars[position()!=last()]"/>
+                                                               </element>
+                                                               <element name="figcaption" namespace="&xhtml;">
+                                                                       <copy-of select="$innerpars[last()]/node()"/>
+                                                               </element>
+                                                       </element>
+                                               </when>
+                                               <when test="$quoted">
+                                                       <element name="blockquote" namespace="&xhtml;">
+                                                               <copy-of select="$innerpars"/>
+                                                       </element>
+                                               </when>
+                                               <when test="$bracketed">
+                                                       <element name="footer" namespace="&xhtml;">
+                                                               <copy-of select="$innerpars"/>
+                                                       </element>
+                                               </when>
+                                       </choose>
+                               </when>
+                               <otherwise>
+                                       <variable name="preformatted" select="$all-prefixed and $prefix='|'"/>
+                                       <variable name="text">
+                                               <for-each select="$linespans">
                                                        <choose>
                                                                <when test="$preformatted">
-                                                                       <text>&#xA;</text>
+                                                                       <value-of select="substring-after(., '|')"/>
                                                                </when>
                                                                <otherwise>
-                                                                       <text> </text>
+                                                                       <value-of select="normalize-space()"/>
                                                                </otherwise>
                                                        </choose>
-                                               </if>
-                                       </for-each>
-                               </variable>
-                               <if test="string($text)!=''">
-                                       <variable name="par">
-                                               <choose>
-                                                       <when test="$preformatted">
-                                                               <element name="pre" namespace="&xhtml;">
+                                                       <if test="position()!=count($linespans)">
+                                                               <choose>
+                                                                       <when test="$preformatted">
+                                                                               <text>&#xA;</text>
+                                                                       </when>
+                                                                       <otherwise>
+                                                                               <text> </text>
+                                                                       </otherwise>
+                                                               </choose>
+                                                       </if>
+                                               </for-each>
+                                       </variable>
+                                       <choose>
+                                               <when test="$preformatted">
+                                                       <element name="pre" namespace="&xhtml;">
+                                                               <call-template name="LesML:id-and-contents">
+                                                                       <with-param name="source" select="$text"/>
+                                                               </call-template>
+                                                       </element>
+                                               </when>
+                                               <when test="string($text)=''"/>
+                                               <when test="starts-with($text, '⁌') and &sigiled-text;">
+                                                       <element name="h1" namespace="&xhtml;">
+                                                               <call-template name="LesML:id-and-contents">
+                                                                       <with-param name="source" select="&unsigiled-text;"/>
+                                                               </call-template>
+                                                       </element>
+                                               </when>
+                                               <when test="starts-with($text, '§') and &sigiled-text;">
+                                                       <element name="h2" namespace="&xhtml;">
+                                                               <call-template name="LesML:id-and-contents">
+                                                                       <with-param name="source" select="&unsigiled-text;"/>
+                                                               </call-template>
+                                                       </element>
+                                               </when>
+                                               <when test="starts-with($text, '❦') and &sigiled-text;">
+                                                       <element name="h3" namespace="&xhtml;">
+                                                               <call-template name="LesML:id-and-contents">
+                                                                       <with-param name="source" select="&unsigiled-text;"/>
+                                                               </call-template>
+                                                       </element>
+                                               </when>
+                                               <when test="starts-with($text, '✠') and &sigiled-text;">
+                                                       <element name="h4" namespace="&xhtml;">
+                                                               <call-template name="LesML:id-and-contents">
+                                                                       <with-param name="source" select="&unsigiled-text;"/>
+                                                               </call-template>
+                                                       </element>
+                                               </when>
+                                               <when test="starts-with($text, '•') and &sigiled-text;">
+                                                       <element name="li" namespace="&xhtml;">
+                                                               <attribute name="class">
+                                                                       <text>unordered</text>
+                                                               </attribute>
+                                                               <attribute name="data-level">
+                                                                       <text>1</text>
+                                                               </attribute>
+                                                               <element name="p" namespace="&xhtml;">
                                                                        <call-template name="LesML:id-and-contents">
-                                                                               <with-param name="source" select="$text"/>
+                                                                               <with-param name="source" select="&unsigiled-text;"/>
                                                                        </call-template>
                                                                </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '⁌') and &sigiled-text;">
-                                                               <element name="h1" namespace="&xhtml;">
+                                                       </element>
+                                               </when>
+                                               <when test="starts-with($text, '🔢') and &sigiled-text;">
+                                                       <element name="li" namespace="&xhtml;">
+                                                               <attribute name="class">
+                                                                       <text>ordered</text>
+                                                               </attribute>
+                                                               <attribute name="data-level">
+                                                                       <text>1</text>
+                                                               </attribute>
+                                                               <element name="p" namespace="&xhtml;">
                                                                        <call-template name="LesML:id-and-contents">
                                                                                <with-param name="source" select="&unsigiled-text;"/>
                                                                        </call-template>
                                                                </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '§') and &sigiled-text;">
-                                                               <element name="h2" namespace="&xhtml;">
+                                                       </element>
+                                               </when>
+                                               <when test="starts-with($text, '◦') and &sigiled-text;">
+                                                       <element name="li" namespace="&xhtml;">
+                                                               <attribute name="class">
+                                                                       <text>unordered</text>
+                                                               </attribute>
+                                                               <attribute name="data-level">
+                                                                       <text>2</text>
+                                                               </attribute>
+                                                               <element name="p" namespace="&xhtml;">
                                                                        <call-template name="LesML:id-and-contents">
                                                                                <with-param name="source" select="&unsigiled-text;"/>
                                                                        </call-template>
                                                                </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '❦') and &sigiled-text;">
-                                                               <element name="h3" namespace="&xhtml;">
+                                                       </element>
+                                               </when>
+                                               <when test="starts-with($text, '🔠') and &sigiled-text;">
+                                                       <element name="li" namespace="&xhtml;">
+                                                               <attribute name="class">
+                                                                       <text>ordered</text>
+                                                               </attribute>
+                                                               <attribute name="data-level">
+                                                                       <text>2</text>
+                                                               </attribute>
+                                                               <element name="p" namespace="&xhtml;">
                                                                        <call-template name="LesML:id-and-contents">
                                                                                <with-param name="source" select="&unsigiled-text;"/>
                                                                        </call-template>
                                                                </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '✠') and &sigiled-text;">
-                                                               <element name="h4" namespace="&xhtml;">
+                                                       </element>
+                                               </when>
+                                               <when test="starts-with($text, '▪') and &sigiled-text;">
+                                                       <element name="li" namespace="&xhtml;">
+                                                               <attribute name="class">
+                                                                       <text>unordered</text>
+                                                               </attribute>
+                                                               <attribute name="data-level">
+                                                                       <text>3</text>
+                                                               </attribute>
+                                                               <element name="p" namespace="&xhtml;">
                                                                        <call-template name="LesML:id-and-contents">
                                                                                <with-param name="source" select="&unsigiled-text;"/>
                                                                        </call-template>
                                                                </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '•') and &sigiled-text;">
-                                                               <element name="li" namespace="&xhtml;">
-                                                                       <attribute name="class">
-                                                                               <text>unordered</text>
-                                                                       </attribute>
-                                                                       <attribute name="data-level">
-                                                                               <text>1</text>
-                                                                       </attribute>
-                                                                       <element name="p" namespace="&xhtml;">
-                                                                               <call-template name="LesML:id-and-contents">
-                                                                                       <with-param name="source" select="&unsigiled-text;"/>
-                                                                               </call-template>
-                                                                       </element>
-                                                               </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '🔢') and &sigiled-text;">
-                                                               <element name="li" namespace="&xhtml;">
-                                                                       <attribute name="class">
-                                                                               <text>ordered</text>
-                                                                       </attribute>
-                                                                       <attribute name="data-level">
-                                                                               <text>1</text>
-                                                                       </attribute>
-                                                                       <element name="p" namespace="&xhtml;">
-                                                                               <call-template name="LesML:id-and-contents">
-                                                                                       <with-param name="source" select="&unsigiled-text;"/>
-                                                                               </call-template>
-                                                                       </element>
-                                                               </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '◦') and &sigiled-text;">
-                                                               <element name="li" namespace="&xhtml;">
-                                                                       <attribute name="class">
-                                                                               <text>unordered</text>
-                                                                       </attribute>
-                                                                       <attribute name="data-level">
-                                                                               <text>2</text>
-                                                                       </attribute>
-                                                                       <element name="p" namespace="&xhtml;">
-                                                                               <call-template name="LesML:id-and-contents">
-                                                                                       <with-param name="source" select="&unsigiled-text;"/>
-                                                                               </call-template>
-                                                                       </element>
-                                                               </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '🔠') and &sigiled-text;">
-                                                               <element name="li" namespace="&xhtml;">
-                                                                       <attribute name="class">
-                                                                               <text>ordered</text>
-                                                                       </attribute>
-                                                                       <attribute name="data-level">
-                                                                               <text>2</text>
-                                                                       </attribute>
-                                                                       <element name="p" namespace="&xhtml;">
-                                                                               <call-template name="LesML:id-and-contents">
-                                                                                       <with-param name="source" select="&unsigiled-text;"/>
-                                                                               </call-template>
-                                                                       </element>
-                                                               </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '▪') and &sigiled-text;">
-                                                               <element name="li" namespace="&xhtml;">
-                                                                       <attribute name="class">
-                                                                               <text>unordered</text>
-                                                                       </attribute>
-                                                                       <attribute name="data-level">
-                                                                               <text>3</text>
-                                                                       </attribute>
-                                                                       <element name="p" namespace="&xhtml;">
-                                                                               <call-template name="LesML:id-and-contents">
-                                                                                       <with-param name="source" select="&unsigiled-text;"/>
-                                                                               </call-template>
-                                                                       </element>
-                                                               </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '🔡') and &sigiled-text;">
-                                                               <element name="li" namespace="&xhtml;">
-                                                                       <attribute name="class">
-                                                                               <text>ordered</text>
-                                                                       </attribute>
-                                                                       <attribute name="data-level">
-                                                                               <text>3</text>
-                                                                       </attribute>
-                                                                       <element name="p" namespace="&xhtml;">
-                                                                               <call-template name="LesML:id-and-contents">
-                                                                                       <with-param name="source" select="&unsigiled-text;"/>
-                                                                               </call-template>
-                                                                       </element>
-                                                               </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '⁃') and &sigiled-text;">
-                                                               <element name="li" namespace="&xhtml;">
-                                                                       <attribute name="class">
-                                                                               <text>unordered</text>
-                                                                       </attribute>
-                                                                       <attribute name="data-level">
-                                                                               <text>4</text>
-                                                                       </attribute>
-                                                                       <element name="p" namespace="&xhtml;">
-                                                                               <call-template name="LesML:id-and-contents">
-                                                                                       <with-param name="source" select="&unsigiled-text;"/>
-                                                                               </call-template>
-                                                                       </element>
-                                                               </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '🔣') and &sigiled-text;">
-                                                               <element name="li" namespace="&xhtml;">
-                                                                       <attribute name="class">
-                                                                               <text>ordered</text>
-                                                                       </attribute>
-                                                                       <attribute name="data-level">
-                                                                               <text>4</text>
-                                                                       </attribute>
-                                                                       <element name="p" namespace="&xhtml;">
-                                                                               <call-template name="LesML:id-and-contents">
-                                                                                       <with-param name="source" select="&unsigiled-text;"/>
-                                                                               </call-template>
-                                                                       </element>
+                                                       </element>
+                                               </when>
+                                               <when test="starts-with($text, '🔡') and &sigiled-text;">
+                                                       <element name="li" namespace="&xhtml;">
+                                                               <attribute name="class">
+                                                                       <text>ordered</text>
+                                                               </attribute>
+                                                               <attribute name="data-level">
+                                                                       <text>3</text>
+                                                               </attribute>
+                                                               <element name="p" namespace="&xhtml;">
+                                                                       <call-template name="LesML:id-and-contents">
+                                                                               <with-param name="source" select="&unsigiled-text;"/>
+                                                                       </call-template>
                                                                </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '🛈') and &sigiled-text;">
-                                                               <element name="div" namespace="&xhtml;">
-                                                                       <attribute name="role">
-                                                                               <text>note</text>
-                                                                       </attribute>
-                                                                       <attribute name="class">
-                                                                               <text>info</text>
-                                                                       </attribute>
-                                                                       <element name="p" namespace="&xhtml;">
-                                                                               <call-template name="LesML:id-and-contents">
-                                                                                       <with-param name="source" select="&unsigiled-text;"/>
-                                                                               </call-template>
-                                                                       </element>
+                                                       </element>
+                                               </when>
+                                               <when test="starts-with($text, '⁃') and &sigiled-text;">
+                                                       <element name="li" namespace="&xhtml;">
+                                                               <attribute name="class">
+                                                                       <text>unordered</text>
+                                                               </attribute>
+                                                               <attribute name="data-level">
+                                                                       <text>4</text>
+                                                               </attribute>
+                                                               <element name="p" namespace="&xhtml;">
+                                                                       <call-template name="LesML:id-and-contents">
+                                                                               <with-param name="source" select="&unsigiled-text;"/>
+                                                                       </call-template>
                                                                </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '⯑') and &sigiled-text;">
-                                                               <element name="div" namespace="&xhtml;">
-                                                                       <attribute name="role">
-                                                                               <text>note</text>
-                                                                       </attribute>
-                                                                       <attribute name="class">
-                                                                               <text>query</text>
-                                                                       </attribute>
-                                                                       <element name="p" namespace="&xhtml;">
-                                                                               <call-template name="LesML:id-and-contents">
-                                                                                       <with-param name="source" select="&unsigiled-text;"/>
-                                                                               </call-template>
-                                                                       </element>
+                                                       </element>
+                                               </when>
+                                               <when test="starts-with($text, '🔣') and &sigiled-text;">
+                                                       <element name="li" namespace="&xhtml;">
+                                                               <attribute name="class">
+                                                                       <text>ordered</text>
+                                                               </attribute>
+                                                               <attribute name="data-level">
+                                                                       <text>4</text>
+                                                               </attribute>
+                                                               <element name="p" namespace="&xhtml;">
+                                                                       <call-template name="LesML:id-and-contents">
+                                                                               <with-param name="source" select="&unsigiled-text;"/>
+                                                                       </call-template>
                                                                </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '⚠︎') and &sigiled-text;">
-                                                               <element name="div" namespace="&xhtml;">
-                                                                       <attribute name="role">
-                                                                               <text>note</text>
-                                                                       </attribute>
-                                                                       <attribute name="class">
-                                                                               <text>warn</text>
-                                                                       </attribute>
-                                                                       <element name="p" namespace="&xhtml;">
-                                                                               <call-template name="LesML:id-and-contents">
-                                                                                       <with-param name="source" select="&unsigiled-text;"/>
-                                                                               </call-template>
-                                                                       </element>
+                                                       </element>
+                                               </when>
+                                               <when test="starts-with($text, '🛈') and &sigiled-text;">
+                                                       <element name="div" namespace="&xhtml;">
+                                                               <attribute name="role">
+                                                                       <text>note</text>
+                                                               </attribute>
+                                                               <attribute name="class">
+                                                                       <text>info</text>
+                                                               </attribute>
+                                                               <element name="p" namespace="&xhtml;">
+                                                                       <call-template name="LesML:id-and-contents">
+                                                                               <with-param name="source" select="&unsigiled-text;"/>
+                                                                       </call-template>
                                                                </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '※') and &sigiled-text;">
-                                                               <element name="div" namespace="&xhtml;">
-                                                                       <attribute name="role">
-                                                                               <text>note</text>
-                                                                       </attribute>
-                                                                       <attribute name="class">
-                                                                               <text>note</text>
-                                                                       </attribute>
-                                                                       <element name="p" namespace="&xhtml;">
-                                                                               <call-template name="LesML:id-and-contents">
-                                                                                       <with-param name="source" select="&unsigiled-text;"/>
-                                                                               </call-template>
-                                                                       </element>
+                                                       </element>
+                                               </when>
+                                               <when test="starts-with($text, '⯑') and &sigiled-text;">
+                                                       <element name="div" namespace="&xhtml;">
+                                                               <attribute name="role">
+                                                                       <text>note</text>
+                                                               </attribute>
+                                                               <attribute name="class">
+                                                                       <text>query</text>
+                                                               </attribute>
+                                                               <element name="p" namespace="&xhtml;">
+                                                                       <call-template name="LesML:id-and-contents">
+                                                                               <with-param name="source" select="&unsigiled-text;"/>
+                                                                       </call-template>
                                                                </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '☡') and &sigiled-text;">
-                                                               <element name="div" namespace="&xhtml;">
-                                                                       <attribute name="role">
-                                                                               <text>note</text>
-                                                                       </attribute>
-                                                                       <attribute name="class">
-                                                                               <text>caution</text>
-                                                                       </attribute>
-                                                                       <element name="p" namespace="&xhtml;">
-                                                                               <call-template name="LesML:id-and-contents">
-                                                                                       <with-param name="source" select="&unsigiled-text;"/>
-                                                                               </call-template>
-                                                                       </element>
+                                                       </element>
+                                               </when>
+                                               <when test="starts-with($text, '⚠︎') and &sigiled-text;">
+                                                       <element name="div" namespace="&xhtml;">
+                                                               <attribute name="role">
+                                                                       <text>note</text>
+                                                               </attribute>
+                                                               <attribute name="class">
+                                                                       <text>warn</text>
+                                                               </attribute>
+                                                               <element name="p" namespace="&xhtml;">
+                                                                       <call-template name="LesML:id-and-contents">
+                                                                               <with-param name="source" select="&unsigiled-text;"/>
+                                                                       </call-template>
                                                                </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '⋯') and &sigiled-text;">
-                                                               <element name="div" namespace="&xhtml;">
-                                                                       <attribute name="class">
-                                                                               <text>continuation</text>
-                                                                       </attribute>
-                                                                       <element name="p" namespace="&xhtml;">
-                                                                               <call-template name="LesML:id-and-contents">
-                                                                                       <with-param name="source" select="&unsigiled-text;"/>
-                                                                               </call-template>
-                                                                       </element>
+                                                       </element>
+                                               </when>
+                                               <when test="starts-with($text, '※') and &sigiled-text;">
+                                                       <element name="div" namespace="&xhtml;">
+                                                               <attribute name="role">
+                                                                       <text>note</text>
+                                                               </attribute>
+                                                               <attribute name="class">
+                                                                       <text>note</text>
+                                                               </attribute>
+                                                               <element name="p" namespace="&xhtml;">
+                                                                       <call-template name="LesML:id-and-contents">
+                                                                               <with-param name="source" select="&unsigiled-text;"/>
+                                                                       </call-template>
                                                                </element>
-                                                       </when>
-                                                       <when test="starts-with($text, '#') and &sigiled-text;">
-                                                               <call-template name="LesML:comment-out">
-                                                                       <with-param name="source" select="&unsigiled-text;"/>
-                                                               </call-template>
-                                                       </when>
-                                                       <otherwise>
+                                                       </element>
+                                               </when>
+                                               <when test="starts-with($text, '☡') and &sigiled-text;">
+                                                       <element name="div" namespace="&xhtml;">
+                                                               <attribute name="role">
+                                                                       <text>note</text>
+                                                               </attribute>
+                                                               <attribute name="class">
+                                                                       <text>caution</text>
+                                                               </attribute>
                                                                <element name="p" namespace="&xhtml;">
                                                                        <call-template name="LesML:id-and-contents">
-                                                                               <with-param name="source" select="$text"/>
+                                                                               <with-param name="source" select="&unsigiled-text;"/>
                                                                        </call-template>
                                                                </element>
-                                                       </otherwise>
-                                               </choose>
-                                       </variable>
-                                       <choose>
-                                               <when test="translate(string($text), '&section-break; ', '')=''">
-                                                       <element name="hr" namespace="&xhtml;"/>
+                                                       </element>
                                                </when>
-                                               <when test="$quoted">
-                                                       <element name="blockquote" namespace="&xhtml;">
-                                                               <copy-of select="$par"/>
+                                               <when test="starts-with($text, '⋯') and &sigiled-text;">
+                                                       <element name="div" namespace="&xhtml;">
+                                                               <attribute name="class">
+                                                                       <text>continuation</text>
+                                                               </attribute>
+                                                               <element name="p" namespace="&xhtml;">
+                                                                       <call-template name="LesML:id-and-contents">
+                                                                               <with-param name="source" select="&unsigiled-text;"/>
+                                                                       </call-template>
+                                                               </element>
                                                        </element>
                                                </when>
+                                               <when test="starts-with($text, '#') and &sigiled-text;">
+                                                       <call-template name="LesML:comment-out">
+                                                               <with-param name="source" select="&unsigiled-text;"/>
+                                                       </call-template>
+                                               </when>
                                                <otherwise>
-                                                       <copy-of select="$par"/>
+                                                       <element name="p" namespace="&xhtml;">
+                                                               <call-template name="LesML:id-and-contents">
+                                                                       <with-param name="source" select="$text"/>
+                                                               </call-template>
+                                                       </element>
                                                </otherwise>
                                        </choose>
-                               </if>
-                       </for-each>
+                               </otherwise>
+                       </choose>
+               </for-each>
+       </template>
+       <template name="LesML:paragraphize">
+               <param name="lines" select="/.."/>
+               <variable name="blocked-fragment">
+                       <call-template name="LesML:block">
+                               <with-param name="lines" select="$lines"/>
+                       </call-template>
                </variable>
-               <variable name="inlined">
-                       <apply-templates select="exsl:node-set($blocked)/node()" mode="LesML:comment"/>
+               <variable name="inlined-fragment">
+                       <apply-templates select="exsl:node-set($blocked-fragment)/node()" mode="LesML:comment"/>
                </variable>
-               <apply-templates select="exsl:node-set($inlined)/node()" mode="LesML:finalize-tree"/>
+               <apply-templates select="exsl:node-set($inlined-fragment)/node()" mode="LesML:finalize-tree"/>
        </template>
        <template match="html:script[@type='text/lesml']">
                <variable name="lines-fragment">
@@ -734,45 +782,6 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
                        </if>
                </element>
        </template>
-       <template match="html:blockquote" mode="LesML:finalize-tree">
-               <if test="not(preceding-sibling::node()) or preceding-sibling::node()[position()=1 and not(self::html:blockquote)]">
-                       <variable name="notquote" select="following-sibling::node()[not(self::html:blockquote)][1]"/>
-                       <variable name="contents">
-                               <copy-of select="node()"/>
-                               <for-each select="exslset:leading(following-sibling::node(), $notquote)">
-                                       <copy-of select="node()"/>
-                               </for-each>
-                       </variable>
-                       <variable name="content-nodes" select="exsl:node-set($contents)/node()"/>
-                       <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()]"/>
-                       <choose>
-                               <when test="starts-with($laststarttext, '— ')">
-                                       <variable name="caption">
-                                               <copy-of select="$laststarttext/preceding-sibling::node()"/>
-                                               <value-of select="substring-after($laststarttext, '— ')"/>
-                                               <copy-of select="$laststarttext/following-sibling::node()"/>
-                                       </variable>
-                                       <element name="figure" namespace="&xhtml;">
-                                               <copy>
-                                                       <apply-templates select="@*|$content-nodes[position()!=last()]" mode="LesML:finalize-tree"/>
-                                               </copy>
-                                               <element name="figcaption" namespace="&xhtml;">
-                                                       <for-each select="$content-nodes[last()]">
-                                                               <copy>
-                                                                       <apply-templates select="@*|exsl:node-set($caption)/node()" mode="LesML:finalize-tree"/>
-                                                               </copy>
-                                                       </for-each>
-                                               </element>
-                                       </element>
-                               </when>
-                               <otherwise>
-                                       <copy>
-                                               <apply-templates select="@*|$content-nodes" mode="LesML:finalize-tree"/>
-                                       </copy>
-                               </otherwise>
-                       </choose>
-               </if>
-       </template>
        <template match="html:div" mode="LesML:finalize-tree">
                <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)]">
                        <variable name="notcontinuation" select="following-sibling::node()[not(self::html:div and @class='continuation')][1]"/>
This page took 0.565287 seconds and 4 git commands to generate.