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/0b65ee4b9fea227f3fdd492b78288a987dde451dd6143b32be934c0855f431e7 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 codepoint to use curly braces rather than angle brackets, as the latter conflicted with the angle brackets used in links. Specifying by Unicode codepoint still isn¦t supported in links, but the behaviour should be less surprising. The old Unicode codepoint behaviour was probably broken also, in the case where the codepoint was not the first character in a paragraph, but it is fixed now. --- diff --git a/README.markdown b/README.markdown index 160c8c3..52ac8f8 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 1baa48d..a264b21 100644 --- a/parser.xslt +++ b/parser.xslt @@ -1,12 +1,12 @@