Skip to content

Commit

Permalink
fix: support embedded escaped quotes in strings
Browse files Browse the repository at this point in the history
  • Loading branch information
korrat authored and polarmutex committed Mar 29, 2024
1 parent 6c665e7 commit 9f6eb73
Show file tree
Hide file tree
Showing 4 changed files with 1,108 additions and 1,057 deletions.
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ module.exports = grammar({
),
),
currency: $ => token(/[A-Z][A-Z0-9\'\._\-]{0,22}[A-Z0-9]/),
string: $ => token(/"[^"]*"/),
string: $ => token(/"([^"]|\\")*"/),
number: $ => token(/([0-9]+|[0-9][0-9,]+[0-9])(\.[0-9]*)?/),
tag: $ => token(/#[A-Za-z0-9\-_/.]+/),
link: $ => token(/\^[A-Za-z0-9\-_/.]+/),
Expand Down
2 changes: 1 addition & 1 deletion src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
"type": "TOKEN",
"content": {
"type": "PATTERN",
"value": "\"[^\"]*\""
"value": "\"([^\"]|\\\\\")*\""
}
},
"number": {
Expand Down
Loading

0 comments on commit 9f6eb73

Please # to comment.