grammar: add escape sequence for label and attr value

This commit is contained in:
Dmitriy Pleshevskiy 2023-01-05 16:53:09 +03:00
parent b9fa5785b4
commit 32b1fa5555
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215

View file

@ -293,7 +293,17 @@ module.exports = grammar({
dot: ($) => token("."),
_unquoted_string: ($) =>
token(prec(PREC.UNQUOTED_STRING, /[^'"`|\n\s;{}]([^\n;{}]*[^\n\s;{}])?/)),
repeat1(
choice(
$.escape_sequence,
token(
prec(
PREC.UNQUOTED_STRING,
/[^'"`\\|\n\s;{}]([^\\\n;{}]*[^\\\n\s;{}])?/
)
)
)
),
string: ($) =>
choice(