On reflection, new style values should not be allowed for anonymous parameters

Backwards compatibility
This commit is contained in:
Jeremy Ruston
2026-01-25 20:27:01 +00:00
parent a29ae908e2
commit 8ebf052e25
3 changed files with 2 additions and 11 deletions

View File

@@ -287,7 +287,7 @@ exports.parseMacroParameterAsAttribute = function(source,pos) {
var nameToken = $tw.utils.parseTokenRegExp(source,pos,reAttributeName), var nameToken = $tw.utils.parseTokenRegExp(source,pos,reAttributeName),
namePos = nameToken && $tw.utils.skipWhiteSpace(source,nameToken.end), namePos = nameToken && $tw.utils.skipWhiteSpace(source,nameToken.end),
separatorToken = nameToken && $tw.utils.parseTokenRegExp(source,namePos,/=|:/g), separatorToken = nameToken && $tw.utils.parseTokenRegExp(source,namePos,/=|:/g),
isNewStyleSeparator = true; // If there is no separator then we allow new style values isNewStyleSeparator = false; // If there is no separator then we don't allow new style values
// If we have a name and a separator then we have a named attribute // If we have a name and a separator then we have a named attribute
if(nameToken && separatorToken) { if(nameToken && separatorToken) {
node.name = nameToken.match[1]; node.name = nameToken.match[1];

View File

@@ -13,10 +13,6 @@ It is $param$
- -
<$text text=<<mamacromamacro param={{{ [[a]addprefix[b]] }}}>>/> <$text text=<<mamacromamacro param={{{ [[a]addprefix[b]] }}}>>/>
- -
<$text text=<<mamacromamacro param={{{ [[b]addprefix[a]] }}}>>/>
-
<$text text=<<mamacromamacro {{{ [[b]addprefix[a]] }}}>>/>
-
<$text text=<<mamacromamacro param>>/> <$text text=<<mamacromamacro param>>/>
+ +
@@ -26,9 +22,5 @@ title: ExpectedResult
- -
It is ba It is ba
- -
It is ab
-
It is ab
-
It is param It is param
</p> </p>

View File

@@ -15,10 +15,9 @@ It is $one$ and $two$ or <<__one__>> and <<__two__>>.
<<mamacro one={{{ [[b]addprefix[a]] }}}>> <<mamacro one={{{ [[b]addprefix[a]] }}}>>
<<mamacro {{{ [[b]addprefix[a]] }}}>>
<<mamacro one>> <<mamacro one>>
+ +
title: ExpectedResult title: ExpectedResult
<p>It is red and green or red and green.</p><p>It is ab and green or ab and green.</p><p>It is ab and green or ab and green.</p><p>It is one and green or one and green.</p> <p>It is red and green or red and green.</p><p>It is ab and green or ab and green.</p><p>It is one and green or one and green.</p>