]> Lady’s Gitweb - LesML/commitdiff
Allow colons in header record terms 🆕
authorLady <redacted>
Sat, 8 Aug 2026 04:43:47 +0000 (00:43 -0400)
committerLady <redacted>
Sat, 8 Aug 2026 06:17:07 +0000 (02:17 -0400)
This commit changes the Record‐Jar processing to allow colons in terms,
  since colons in values can be provided by using a continuation line.
This change allows for the use of I·R·I¦s as terms, which can be
  beneficial for some kinds of metadata.

Message-type: text/lesml

TESTING/ð\9f\93¤/keys-and-values
TESTING/ð\9f\93¥/bad-key [new file with mode: 0644]
TESTING/ð\9f\93¥/keys-and-values
xslt/lesml.xslt

index 7c342843d725c46d925c99d55caf55395efe1b0d8d9ba4bc3c8d61706f32fafc..76bed6d5fb2ee283f018ade67730d566179980ea4d416e58566af8f1bd5c778d 100644 (file)
@@ -1,2 +1,2 @@
 <?xml version="1.0"?>
 <?xml version="1.0"?>
-<div xmlns="http://www.w3.org/1999/xhtml"><!-- document comment--><!-- this is allowed following the opening shebang--><article lang="en" xml:lang="en" data-lesml-profile="about:test"><footer class="head"><dl><div><dt>Key</dt><dd>Value</dd></div></dl><!--comm--><!--ent--><dl><div><dt/><dd>Key value</dd></div></dl><dl><div><dt>multiline</dt><dd>keyand value</dd></div></dl><dl><div><dt>bad spaced</dt><dd>key</dd></div></dl></footer><div class="body"/></article></div>
+<div xmlns="http://www.w3.org/1999/xhtml"><!-- document comment--><!-- this is allowed following the opening shebang--><article lang="en" xml:lang="en" data-lesml-profile="about:test"><footer class="head"><dl><div><dt>Key</dt><dd>Value</dd></div></dl><!--comm--><!--ent--><dl><div><dt>multiline</dt><dd>keyand value</dd></div></dl><dl><div><dt>bad spaced</dt><dd>key</dd></div></dl><dl><div><dt>urn:fdc:example.com:0000:key_with_colon</dt><dd>a value</dd></div><div><dt>a key</dt><dd>a:value:with:a:colon</dd></div></dl></footer><div class="body"/></article></div>
diff --git a/TESTING/ð\9f\93¥/bad-key b/TESTING/ð\9f\93¥/bad-key
new file mode 100644 (file)
index 0000000..d67d91a
--- /dev/null
@@ -0,0 +1,6 @@
+#?lesml@en$ profile=about:test
+## document comment
+## this is allowed following the opening shebang
+%%
+Key Value
+%%
index 62187d2625201a986934f2c56e75079c4bcf9331bdc8aa7dc4f1dc99a01e9505..b4217a514b87cf3384fb2ff469baa2703523840042c4d65e3c2c5da26b64f924 100644 (file)
@@ -5,11 +5,13 @@
 Key : Value
 %%comm
 %%ent
 Key : Value
 %%comm
 %%ent
-Key value
-%%
 multiline: key
   and \
   value
 %%
   bad spaced : key
 %%
 multiline: key
   and \
   value
 %%
   bad spaced : key
 %%
+urn:fdc:example.com:0000:key_with_colon: a value
+a key:
+  a:value:with:a:colon
+%%
index 61539dda4b77146b7074cf5e04f10cfc247e2be9db5625ab3d703fdf769e11ed..dc9485dacdde8477c1e6f2ea1f6fb5136edfc843996c35fb5069efed129ec539 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <!--
 <?xml version="1.0"?>
 <!--
-@(#)💄📝 Les·M·L xslt/lesml.xslt 2026-03-31T01:31:16Z
+@(#)💄📝 Les·M·L xslt/lesml.xslt 2026-08-08T04:43:47Z
 SPDX-FileCopyrightText: 2024, 2025, 2026 Lady <https://www.ladys.computer/about/#lady>
 SPDX-License-Identifier: MPL-2.0
 -->
 SPDX-FileCopyrightText: 2024, 2025, 2026 Lady <https://www.ladys.computer/about/#lady>
 SPDX-License-Identifier: MPL-2.0
 -->
@@ -917,22 +917,29 @@ This template operates by outputting the result of the first document
                                                                                <choose>
                                                                                        <when test="contains(' &#x9;', substring(., 1, 1)) and exslset:has-same-node($fields, preceding-sibling::*[1])"/>
                                                                                        <otherwise>
                                                                                <choose>
                                                                                        <when test="contains(' &#x9;', substring(., 1, 1)) and exslset:has-same-node($fields, preceding-sibling::*[1])"/>
                                                                                        <otherwise>
+                                                                                               <variable name="firstsplit" select="LesML:split(., ':')"/>
+                                                                                               <variable name="term">
+                                                                                                       <for-each select="$firstsplit[last()>position()]">
+                                                                                                               <if test="position()>1">
+                                                                                                                       <text>:</text>
+                                                                                                               </if>
+                                                                                                               <value-of select="."/>
+                                                                                                       </for-each>
+                                                                                               </variable>
+                                                                                               <variable name="firstline">
+                                                                                                       <value-of select="normalize-space($firstsplit[last()])"/>
+                                                                                               </variable>
                                                                                                <variable name="next" select="$following[not(contains(' &#x9;', substring(., 1, 1)))][1]"/>
                                                                                                <variable name="next" select="$following[not(contains(' &#x9;', substring(., 1, 1)))][1]"/>
+                                                                                               <if test="2>count($firstsplit)">
+                                                                                                       <message terminate="yes">
+                                                                                                               <text>Invalid field: Missing colon.</text>
+                                                                                                       </message>
+                                                                                               </if>
                                                                                                <element name="div" namespace="&xhtml;">
                                                                                                        <element name="dt" namespace="&xhtml;">
                                                                                                <element name="div" namespace="&xhtml;">
                                                                                                        <element name="dt" namespace="&xhtml;">
-                                                                                                               <value-of select="normalize-space(substring-before(., ':'))"/>
+                                                                                                               <value-of select="normalize-space($term)"/>
                                                                                                        </element>
                                                                                                        <element name="dd" namespace="&xhtml;">
                                                                                                        </element>
                                                                                                        <element name="dd" namespace="&xhtml;">
-                                                                                                               <variable name="firstline">
-                                                                                                                       <choose>
-                                                                                                                               <when test="contains(., ':')">
-                                                                                                                                       <value-of select="normalize-space(substring-after(., ':'))"/>
-                                                                                                                               </when>
-                                                                                                                               <otherwise>
-                                                                                                                                       <value-of select="normalize-space(.)"/>
-                                                                                                                               </otherwise>
-                                                                                                                       </choose>
-                                                                                                               </variable>
                                                                                                                <choose>
                                                                                                                        <when test="substring($firstline, string-length($firstline))='\' and $following[position()=1 and contains(' &#x9;', substring(., 1, 1))]">
                                                                                                                                <value-of select="substring($firstline, 1, string-length($firstline)-1)"/>
                                                                                                                <choose>
                                                                                                                        <when test="substring($firstline, string-length($firstline))='\' and $following[position()=1 and contains(' &#x9;', substring(., 1, 1))]">
                                                                                                                                <value-of select="substring($firstline, 1, string-length($firstline)-1)"/>
This page took 0.346912 seconds and 4 git commands to generate.