Allow "*/" inside commented out shortcodes

Fixes #4608
This commit is contained in:
Bjørn Erik Pedersen 2018-04-11 22:41:48 +02:00
parent 96689a5c31
commit 14c35c8a56
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
2 changed files with 4 additions and 5 deletions

View file

@ -145,10 +145,12 @@ var shortCodeLexerTests = []shortCodeLexerTest{
{tError, 0, "got named parameter 'param2'. Cannot mix named and positional parameters"}}},
{"commented out", `{{</* sc1 */>}}`, []item{
{tText, 0, "{{<"}, {tText, 0, " sc1 "}, {tText, 0, ">}}"}, tstEOF}},
{"commented out, with asterisk inside", `{{</* sc1 "**/*.pdf" */>}}`, []item{
{tText, 0, "{{<"}, {tText, 0, " sc1 \"**/*.pdf\" "}, {tText, 0, ">}}"}, tstEOF}},
{"commented out, missing close", `{{</* sc1 >}}`, []item{
{tError, 0, "comment must be closed"}}},
{"commented out, misplaced close", `{{</* sc1 >}}*/`, []item{
{tText, 0, "{{<"}, {tText, 0, " sc1 >}}"}, {tError, 0, "comment ends before the right shortcode delimiter"}}},
{tError, 0, "comment must be closed"}}},
}
func TestShortcodeLexer(t *testing.T) {