Repository navigation
Description
Style attribute added to span tags in #97793
Currently, it allows setting color and background-color but many times the background color doesn't apply because span is display: inline by default and doesn't have an actual width and height.
Adding display prop to the allowed styles will fix that and also will open up many other (safe) options for layoutting.
e.g, in pretty-ts-errors I had to use codicon classes to apply background-color and make things inlined. That classes bring unwanted styles like user-select: none that prevent selecting and copying the content.
Now it's a huge deal for tens of thousands of developers that can't copy the types from their errors.
I know that no one wants to keep adding styles to the sanitized regex and it opens the barrier for other requests like this but display prop is different. It is not a niche CSS prop, it is one of the most essential props in CSS and one of the few things that markdown can't do.
I made a pull request that add it, I hope it helps: #180498

Activity
yoavbls commentedon Jul 29, 2023
Hi there!
I just wanted to mention that JetBrains released their alternative solution
and their code blocks are copyable.
We don't want to stay behind, It could be so nice if you'll approve this little line in my PR 🙏🏼
https://github.com/microsoft/vscode/pull/180498/files
vscodenpa commentedon Dec 13, 2023
🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
crkit-chan commentedon Aug 27, 2024
Any new updates yet??
dancherb commentedon Dec 4, 2025
I saw this comment last week and it's what made me decide to finally move to Webstorm 🥲
crkit-chan commentedon Dec 4, 2025
You can use Custom CSS and JS loader for now
anthonykim1 commentedon Sep 21, 2026
Verified on macOS 26.6.2 arm64 using VS Code Insiders 1.139.0-insider (
c0f6c8cd52aeceb78b91631bce1b37d161a93d3f).I used a local test extension to render a realistic TypeScript diagnostic hover through the installed Insiders application.
The hover displayed a missing-property error with supplied and required type structures. The supplied type fragment used a sanitized span with
display:inline-block, a selection background color, and rounded corners.Verified:
display:inline-block.inline-block.username: stringandemail: string.user-select: none.Results:
display:inline-blockto create structured Markdown highlights in editor hovers.The missing
display:inline-blockMarkdown span support no longer reproduces in current Insiders.