saner escaping/unescaping of @
and #
sigils
#750
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I say [WIP] but this should be pretty much done.
This changes the escaping of
@
and#
sigils to not use a prepended\
(which gets further escaped byJSON.stringify
, and complicates the unescaping) and instead just increases by 1 any runs of@
or runs of#
.There are still a couple of gotchas:
@
, because there is no further#
unescaping that happens on that string after that point. There's probably a more elegant solution than what I have. Maybe still usestringify
but then immediately unescape the#
ones?'
as the replacement for'
, which we have to now represent as&##39;
. Not really a huge deal - kind of amusing more than anything.This PR does fix the second issue I was seeing, where
@
s were being dropped from strings passed as attributes to nested components when compiled in SSR mode.All existing tests pass, but some more tests should be written.