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

[HTML] Inline-styles are not highlighted correctly #316

Closed
manniL opened this issue Apr 25, 2022 · 9 comments
Closed

[HTML] Inline-styles are not highlighted correctly #316

manniL opened this issue Apr 25, 2022 · 9 comments
Labels
bug Something isn't working upstream

Comments

@manniL
Copy link

manniL commented Apr 25, 2022

Update

Solution/Not an issue

I've created an example through the official shiki demo sandbox. Weirdly, it works as expected there when using the default theme but not when using vitesse-dark nor github-dark 😅


Hey 👋

When using inline styles, e.g. <p style="color: red">Red content</p> while using the html language setting for shiki, they are not highlighted correctly.

grafik

Generated HTML

<pre class="slidev-code shiki shiki-dark" style="background-color: rgb(18, 18, 18);"><code><span class="line"><span style="color: rgb(133, 133, 133);">&lt;</span><span style="color: rgb(66, 153, 136);">p</span><span style="color: rgb(219, 215, 202);"> </span><span style="color: rgb(224, 165, 105);">style</span><span style="color: rgb(133, 133, 133);">=</span><span style="color: rgb(201, 138, 125);">"</span><span style="color: rgb(219, 215, 202);">color: red"</span><span style="color: rgb(133, 133, 133);">&gt;</span><span style="color: rgb(219, 215, 202);">Red content</span><span style="color: rgb(133, 133, 133);">&lt;/</span><span style="color: rgb(66, 153, 136);">p</span><span style="color: rgb(133, 133, 133);">&gt;</span></span></code></pre>
@orta
Copy link
Contributor

orta commented Apr 27, 2022

Interesting, what does the html look like?

@manniL
Copy link
Author

manniL commented Apr 29, 2022

Interesting, what does the html look like?

Added to the original post 😋

@manniL
Copy link
Author

manniL commented May 10, 2022

Okay, seems to be an issue with vitesse-dark and vitesse-light. Closing here ☺️

Update

I've reopened the issue because both themes work fine in VSCode and do not show the problem with the wrong "closing double quote".

Also, the issue does not only apply to vitesse-dark and vitesse-light theme but also to github-dark and github-light (which were used as base for the vitesse themes though).

The issue itself was present also for VSCode (according to primer/github-vscode-theme#163) but has been fixed for VScode as mentioned in the linked issue.

TL;DR

  • Vitesse and GitHub Themes had the "wrong color for inline styles" issues
  • Solved in VS Code for all these themes
  • Still present in Shiki though

@muenzpraeger
Copy link
Collaborator

That should be in now with 0.12.0.

@manniL
Copy link
Author

manniL commented Dec 19, 2022

@muenzpraeger Thanks for the update! I can confirm that it was resolved for the github-dark theme but not for vitesse. Is this an issue of the vitesse template from here on then?

@muenzpraeger
Copy link
Collaborator

@manniL I believe so that it's somehow an issue with the theme.

I tried your example with a few other themes, and only in the vitesse-dark theme I'm seeing a different tokenization than with the other themes.

Personally I'm not very deep into the mechanics - but I'm curious to figure why. So stay tuned for a day or two. ;-)

@octref octref added the bug Something isn't working label Jan 26, 2023
@octref
Copy link
Collaborator

octref commented Jan 26, 2023

The closing quote is an issue with vitesse-dark theme itself:

image

@octref
Copy link
Collaborator

octref commented Jan 27, 2023

The upstream issue is fixed too.

@manniL
Copy link
Author

manniL commented Jan 27, 2023

Thanks a lot @octref 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
Development

No branches or pull requests

4 participants