From: Lady Date: Sat, 22 Mar 2025 01:45:20 +0000 (-0400) Subject: Enable nested tags of the same kind X-Git-Tag: 0.4.0~2 X-Git-Url: https://git.ladys.computer/LesML/commitdiff_plain/440eeff8f1b198dc3028fd4573a0ce871a86fa52 Enable nested tags of the same kind Previously, the processing rules do not allow nesting an element inside of itself: ‹ ☞︎nested ☞︎tags☜︎ like ☞︎this☜︎☜︎ › do not work as expected. This design choice was to (at least) appropriately handle ‹ ☞︎⟨this☜︎ weird ⟨case☜︎⟩ ›, where each inline should stop at the first delimiter. Correct processing starts by looking for end sigils first, not start sigils, backtracking to the last start sigil which precedes it, wrapping that text, and then reprocessing the entire set of nodes until no more end sigils with matching start sigils are found. This commit implements that behaviour, which is of course a fair bit more complicated but should improve the results. It also changes specifying characters by Unicode code·point to use curly braces rather than angle brackets, as the latter conflicted with the angle brackets used in links. Specifying by Unicode code·point still isn’t supported in links, but the behaviour should be less surprising. The old Unicode code·point behaviour was probably broken also, in the case where the code·point was not the first character in a paragraph, but it is fixed now. --- diff --git a/README.markdown b/README.markdown index 2bfa515..6b43717 100644 --- a/README.markdown +++ b/README.markdown @@ -1,5 +1,5 @@ # 💄📝 Les·M·L @@ -241,10 +241,10 @@ Once the tree is built as above, it is remediated into its final form - Linebreaks in preformatted paragraphs are replaced with ``. Finally, any character can be escaped by instead providing its Unicode - codepoint in the form ``, where `NNNN` is one or more + codepoint in the form `{U+NNNN}`, where `NNNN` is one or more hexadecimal digits. Multiple codepoints may be provided separated by periods, as in - `` + `{U+WWWW.ZZZZ}` ## Usage diff --git a/parser.xslt b/parser.xslt index bd510b0..a47b5bb 100644 --- a/parser.xslt +++ b/parser.xslt @@ -1,12 +1,12 @@