mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
Correctly tokenize quotation marks within single token
This commit is contained in:
committed by
Jun Yang
parent
af841dc872
commit
9956c53b09
@@ -69,7 +69,12 @@ export default class Value {
|
||||
tokens.push(str[i++])
|
||||
} else {
|
||||
const j = i++
|
||||
for (; i < str.length && !/[|,:\s]/.test(str[i]); ++i);
|
||||
let ch
|
||||
for (; i < str.length && !/[|,:\s]/.test(ch = str[i]); ++i) {
|
||||
if (ch === '"' || ch === "'") {
|
||||
for (i += 2; i < str.length && str[i - 1] !== ch; ++i);
|
||||
}
|
||||
}
|
||||
tokens.push(str.slice(j, i))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user