mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-29 07:26:40 +00:00
Allow attribute substitution to handle variables containing non-word characters (#7606)
* Added failing test for #7604 * Fix attribute substitution regexp Use the same regexp in wiki.getSubstitutedText as is used in Widget.prototype.substituteVariableReferences. Fixes #7604. * Added a test for a variable name containing spaces
This commit is contained in:
@@ -6,14 +6,16 @@ tags: [[$:/tags/wiki-test-spec]]
|
||||
title: Output
|
||||
|
||||
\whitespace trim
|
||||
<$let project="TiddlyWiki" disabled="true">
|
||||
<$set name="var with spaces" value="spaces">
|
||||
<$let project="TiddlyWiki" disabled="true" var-with-dashes="dashes">
|
||||
<div class=`$(project)$
|
||||
${ [[Hello]addsuffix[There]] }$` attrib=`myvalue` otherattrib=`$(1)$` blankattrib=`` quoted="here" disabled=```$(disabled)$```>
|
||||
${ [[Hello]addsuffix[There]] }$` attrib=`myvalue` otherattrib=`$(1)$` blankattrib=`` quoted="here" disabled=```$(disabled)$``` dashes=`$(var-with-dashes)$` spaces=`$(var with spaces)$`>
|
||||
</div>
|
||||
</$let>
|
||||
</$set>
|
||||
|
||||
+
|
||||
title: ExpectedResult
|
||||
|
||||
<p><div attrib="myvalue" blankattrib="" class="TiddlyWiki
|
||||
HelloThere" disabled="true" otherattrib="" quoted="here"></div></p>
|
||||
HelloThere" dashes="dashes" disabled="true" otherattrib="" quoted="here" spaces="spaces"></div></p>
|
||||
Reference in New Issue
Block a user