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

Highlighting breaks after invalid css in <style> tag #22

Open
OldStarchy opened this issue Aug 18, 2020 · 5 comments
Open

Highlighting breaks after invalid css in <style> tag #22

OldStarchy opened this issue Aug 18, 2020 · 5 comments
Labels

Comments

@OldStarchy
Copy link

Smallest reproducable example is

<style>a</style>

data- attributes are highlighted differently for some reason.
Adding {}</style> anywhere else in the file after the highlighting is broken will fix it.

<span class="foo" style="baz" data-foo="qux">bar</span>
<style>a</style>
<span class="foo" style="baz">bar</span>
<span class="foo" style="baz" data-foo="qux">bar</span>
{}</style>
<span class="foo" style="baz">bar</span>
<span class="foo" style="baz" data-foo="qux">bar</span>

image

I came accross this editing an email template that has HTML comment markers around the style content

<style>
  <!--
    .foo { bar: baz; }
  -->
</style>

However in this case I think its just treating --> as an unfinished selector.

The highlighting changes depending on the last bit of code before the closing </style> tag. The following three each have different results.

--> Not working
-->{ Not working, but different
-->{} OK

@gorriecoe gorriecoe added the bug label Aug 18, 2020
@gorriecoe
Copy link
Collaborator

This is a very similar issue to #12 in which case the issue is inherited from html syntax highlighting. I have had a look into this but am unsure how to resolve it as the html highlighting runs before ss highlighting and can'r be overridden.

@gorriecoe
Copy link
Collaborator

If you check other similar syntax highlighters such as blade or handlebars they have the same issue. If you find a syntax highlighter that resolves this maybe we could use it as a reference.

@OldStarchy
Copy link
Author

In that case, it's better to raise this issue to the appropriate repo, which seems to be the main vscode repo itself.

@OldStarchy
Copy link
Author

Never mind, I think I found an existing issue, I'll cross-link it.

textmate/html.tmbundle#102

@OldStarchy
Copy link
Author

I'll leave it to you if you want to close this issue or leave it open as an ongoing reminder to check the progress of the upstream issue.

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

No branches or pull requests

2 participants