diff --git a/src/parser/tokenizer.js b/src/parser/tokenizer.js index 85e0fd9..95dba2d 100644 --- a/src/parser/tokenizer.js +++ b/src/parser/tokenizer.js @@ -124,17 +124,17 @@ function tokenizer (input) { next() let parseValue = true - let inQuotes = false - if (cur() === '"') { - inQuotes = true + let endChar = '/' + if (cur() === '"' || cur() === "'") { + endChar = cur() next() } while (parseValue) { - if (cur() === '\\' && input[current + 1] === (inQuotes ? '"' : '/')) { - // do nothing... + if (cur() === '\\' && input[current + 1] === endChar) { next() - } else if (cur() === (inQuotes ? '"' : '/')) { + value += cur() // append non-escaped version + } else if (cur() === endChar) { parseValue = false } else { value += cur()