better handling of interpolated spans in html (addresses #70)#71
Merged
blake-regalia merged 4 commits intomasterfrom Jul 28, 2019
Merged
better handling of interpolated spans in html (addresses #70)#71blake-regalia merged 4 commits intomasterfrom
blake-regalia merged 4 commits intomasterfrom
Conversation
Owner
Author
|
Fixed. |
Collaborator
|
just ported your edits into the generator until the diffs were the same. Would like to keep this going so that it works in any other case that seems reasonable as well as other syntaxes. |
Owner
Author
|
Ah, didn’t realize that one was being generated. Thanks (I’m still on windows in any case as it turns out). |
bathos
commented
Jul 27, 2019
nested/src/syntax.js
Outdated
|
|
||
| // If we did not include this case, the ‘<’ would be scoped as ordinary | ||
| // chardata. | ||
| match: /* syntax: sublime-syntax.regexp */ `(</?)(?=\\$\{)`, |
Owner
Author
There was a problem hiding this comment.
not important, but in case you would prefer not to have to worry about double escaping, you may like one of these alternatives:
match: String.raw /* syntax: sublime-syntax.regexp */ `(</?)(?=\$\{)`,
match: /(<\/?)(?=\$\{)/.source,
blake-regalia
approved these changes
Jul 28, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Two tweaks for the baked-in HTML def used for tagged templates. Even though
${pops out of HTML, we can still perform a lookahead for it in the HTML def. This lets us make special exceptions that handle real world usage patterns from ES without really giving up on correctness for uninterpolated HTML source.It hadn’t occurred to me previously that this was possible. This approach could probably help in a few other places, too (or maybe we’re already doing it elsewhere and I just didn’t notice).