Skip to content

Commit

Permalink
feat: Allow single-quotes too
Browse files Browse the repository at this point in the history
  • Loading branch information
mkg20001 committed Aug 1, 2018
1 parent 9b6fd16 commit 21d9233
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/parser/tokenizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 21d9233

Please sign in to comment.