mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-09 19:47:02 +02:00
parser/pageparser: Don't allow parameters after closing tag in shortcodes
Problem: Previously, the following self-closing shortcode syntax was incorrectly allowed: {{% sc / param %}} Solution: Only allow parameters before the self-closing tag
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
bb7b3d3cdb
commit
c939c33fd3
@@ -126,6 +126,9 @@ var shortCodeLexerTests = []lexerTest{
|
||||
{"self-closing with param", `{{< sc1 param1 />}}`, []typeText{
|
||||
tstLeftNoMD, tstSC1, tstParam1, tstSCClose, tstRightNoMD, tstEOF,
|
||||
}, nil},
|
||||
{"self-closing with extra keyword", `{{< sc1 / keyword>}}`, []typeText{
|
||||
tstLeftNoMD, tstSC1, tstSCClose, nti(tError, "closing tag for shortcode 'keyword' does not match start tag"),
|
||||
}, nil},
|
||||
{"multiple self-closing with param", `{{< sc1 param1 />}}{{< sc1 param1 />}}`, []typeText{
|
||||
tstLeftNoMD, tstSC1, tstParam1, tstSCClose, tstRightNoMD,
|
||||
tstLeftNoMD, tstSC1, tstParam1, tstSCClose, tstRightNoMD, tstEOF,
|
||||
|
Reference in New Issue
Block a user