From: Lady <redacted>
Date: Sat, 19 Oct 2024 22:57:17 +0000 (-0400)
Subject: Better handle id‐less pilcrows
X-Git-Tag: 0.3.0^0
X-Git-Url: https://git.ladys.computer/LesML/commitdiff_plain/01a25beff3013bcc89f4b3d5fa4b4b2ce3e635b3

Better handle id‐less pilcrows

A pilcrow is useful to “force” a paragraph when it would otherwise
start with a sigil. These pilcrows may not have id’s; this should be
supported.
---

diff --git a/parser.xslt b/parser.xslt
index d11dfe6..2f028c2 100644
--- a/parser.xslt
+++ b/parser.xslt
@@ -105,9 +105,12 @@ If a copy of the M·P·L was not distributed with this file, You can obtain one
 			<when test="starts-with($source, '¶')">
 				<choose>
 					<when test="contains($source, ' ')">
-						<attribute name="id">
-							<value-of select="substring-before(substring-after($source, '¶'), ' ')"/>
-						</attribute>
+						<variable name="id" select="substring-before(substring-after($source, '¶'), ' ')"/>
+						<if test="$id!=''">
+							<attribute name="id">
+								<value-of select="$id"/>
+							</attribute>
+						</if>
 						<value-of select="substring-after($source, ' ')"/>
 					</when>
 					<otherwise>