parser/pageparser: Fix shortcode nesting regression

This reverts commit a133393eda.

While that commit fixed a bug, it introduced a worse one.

Closes #14054
This commit is contained in:
Bjørn Erik Pedersen
2025-10-16 16:42:49 +02:00
parent 8a57d0f15f
commit 1e91e46520
2 changed files with 1 additions and 7 deletions
@@ -27,7 +27,6 @@ var (
tstRightMD = nti(tRightDelimScWithMarkup, "%}}")
tstSCClose = nti(tScClose, "/")
tstSC1 = nti(tScName, "sc1")
tstSCAnother = nti(tScName, "another")
tstSC1Inline = nti(tScNameInline, "sc1.inline")
tstSC2Inline = nti(tScNameInline, "sc2.inline")
tstSC2 = nti(tScName, "sc2")
@@ -75,10 +74,6 @@ var shortCodeLexerTests = []lexerTest{
tstLeftNoMD, tstSC1, tstRightNoMD, tstLeftNoMD, tstSCClose,
nti(tError, "closing tag for shortcode 'another' does not match start tag"),
}, nil},
{"close wrong, repeated", `{{< sc1 >}}{{< another >}}{{< /another >}}{{< /another >}}`, []typeText{
tstLeftNoMD, tstSC1, tstRightNoMD, tstLeftNoMD, tstSCAnother, tstRightNoMD, tstLeftNoMD, tstSCClose, tstSCAnother, tstRightNoMD, tstLeftNoMD, tstSCClose,
nti(tError, "closing tag for shortcode 'another' does not match start tag"),
}, nil},
{"close, but no open, more", `{{< sc1 >}}{{< /sc1 >}}{{< /another >}}`, []typeText{
tstLeftNoMD, tstSC1, tstRightNoMD, tstLeftNoMD, tstSCClose, tstSC1, tstRightNoMD, tstLeftNoMD, tstSCClose,
nti(tError, "closing tag for shortcode 'another' does not match start tag"),