Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highligh code within braces in JSX attributes as javascript #10

Open
koenpunt opened this issue Aug 17, 2016 · 5 comments
Open

Highligh code within braces in JSX attributes as javascript #10

koenpunt opened this issue Aug 17, 2016 · 5 comments

Comments

@koenpunt
Copy link
Contributor

Currently code within braces of a JSX attribute is scoped as meta.tag-content.jsx. It would be nice if on these nested script parts the scope was not applied.

Eg.

Now:

image

Desired:

image

@jjeising
Copy link
Owner

This is only applied inside attributes and it stems from meta.tag.block.jsx. I'm not sure if it is a good solution to overwrite the tag block inside attributes.

@koenpunt
Copy link
Contributor Author

If there's a scope for an attribute value with braces, excluding it should be trivial I think, by just excluding that scope from the injection. Or do I think too lightly?

@jtbandes
Copy link

I think this would be fixed by changing the themes' "Markup tag" style from using meta.tag to (meta.tag - meta.embedded). Thoughts, @infininight?

@jtbandes
Copy link

Although, perhaps solving this in the grammar instead of the theme would also fix typing pairs for ```...

@infininight
Copy link
Contributor

Since I was called out: I think the current scoping is correct, the Javascript is contained within a tag and should have the meta.tag scope. The coloring provided by the theme is secondary to matching the structure, the coloring can easily exclude embedded cases if that is what is desired. As for typing pairs that can be solved with a preference item adding ``` as a typing pair.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants