Skip to content

Commit

Permalink
RELEASE: v2.34.1
Browse files Browse the repository at this point in the history
## Changelog:

* Fixed a regression in the behavior of the naked variable markup.
  • Loading branch information
tmedwards authored Jan 18, 2021
2 parents 36a8e16 + d0e64c8 commit 47fb839
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/format.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SugarCube",
"version": "2.34.0",
"version": "2.34.1",
"author": "Thomas Michael Edwards <[email protected]>",
"description": "Dependency install configuration for SugarCube's Node.js-hosted build script, build.js.",
"license": "BSD-2-Clause",
Expand Down
8 changes: 5 additions & 3 deletions src/markup/parserlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -1035,15 +1035,17 @@
$variable["property"]
$variable['property']
$variable[$indexOrPropertyVariable]
NOTE: I really do not like how the initial bit of the regexp matches.
*/
name : 'nakedVariable',
profiles : ['core'],
match : `${Patterns.variable}(?:(?:\\.${Patterns.identifier})|(?:\\[\\d+\\])|(?:\\["(?:\\\\.|[^"\\\\])+"\\])|(?:\\['(?:\\\\.|[^'\\\\])+'\\])|(?:\\[${Patterns.variable}\\]))*`,

handler(w) {
const result = stringFrom(State.getVar(w.matchText));
const result = State.getVar(w.matchText);

if (result === null) {
if (result == null) { // lazy equality for null
jQuery(document.createTextNode(w.matchText)).appendTo(w.output);
}
else {
Expand All @@ -1052,7 +1054,7 @@
? new DebugView(w.output, 'variable', w.matchText, w.matchText) // Debug view setup.
: w
).output,
result
stringFrom(result)
);
}
}
Expand Down

0 comments on commit 47fb839

Please sign in to comment.