[HTML] Inline-styles are not highlighted correctly
See original GitHub issueUpdate
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.
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);"><</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);">></span><span style="color: rgb(219, 215, 202);">Red content</span><span style="color: rgb(133, 133, 133);"></</span><span style="color: rgb(66, 153, 136);">p</span><span style="color: rgb(133, 133, 133);">></span></span></code></pre>
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
CSS isn't working in any browser unless I use inline styles
Your style rule is just fine. If that rule is present in a correctly-loaded stylesheet, the browser will apply it. Here's how you...
Read more >The inline styles are not working (Example) - Treehouse
The inline styles are not showing for body and h1 tags when I hit preview. Here's my code: <!DOCTYPE html> <html> <head> <title>Lake ......
Read more >Inline Styles in HTML - Codecademy
This problem can be created with any CSS, not just inline styles, but it is worth mentioning here. Always look for the right...
Read more >CSS works inline but not properly when I move it to ... - SitePoint
Hi all This is the original html with the css inline: <div style="width:80%;float:left;text-align:center;color:white;padding:0px ...
Read more >Render as pdf with css not working properly
Below are the few thing i would like to you utilize in Visualforce PDF format, That make you achieve some what reach the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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. 😉
Okay, seems to be an issue withvitesse-dark
andvitesse-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
andvitesse-light
theme but also togithub-dark
andgithub-light
(which were used as base for the vitesse themes though).The issue itself was present also for VSCode (according to https://github.com/primer/github-vscode-theme/issues/163) but has been fixed for VScode as mentioned in the linked issue.
TL;DR