Skip to content

Commit be7612d

Browse files
Steve O'Haramarijnh
authored andcommitted
[velocity mode] Fix parsing of variables in nested quotes
Closes codemirror#3876
1 parent d9b821a commit be7612d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

mode/velocity/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ <h2>Velocity mode</h2>
7777

7878
$someObject("This plus $something in the middle").method(7567).property
7979

80+
#set($something = "Parseable string with '$quotes'!")
81+
8082
#macro( tablerows $color $somelist )
8183
#foreach( $something in $somelist )
8284
<tr><td bgcolor=$color>$something</td></tr>

mode/velocity/velocity.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ CodeMirror.defineMode("velocity", function() {
3434
state.beforeParams = false;
3535
var ch = stream.next();
3636
// start of unparsed string?
37-
if ((ch == "'") && state.inParams) {
37+
if ((ch == "'") && !state.inString && state.inParams) {
3838
state.lastTokenWasBuiltin = false;
3939
return chain(stream, state, tokenString(ch));
4040
}

0 commit comments

Comments
 (0)