Skip to content

Highlight only elements with a whole language class - #4202

Open
DmitrySharabin wants to merge 1 commit into
v2from
whole-language-class
Open

DmitrySharabin wants to merge 1 commit into
v2from
whole-language-class

Conversation

@DmitrySharabin

@DmitrySharabin DmitrySharabin commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

highlightAll() matched [class*="language-"] and [class*="lang-"] as substrings, so any element whose class merely contains them got language-none and tabindex="0":

                                                     before   after
<code class="x language-css">                        ✓        ✓
<code class="x
          language-css">  (tab or line feed)         ✓        ✓
<code class="copy-language-python">  (#3363)         ✓        —
<article class="post tag-golang-tips"> … <code>      ✓        —
<article class="post category-language-learning">    ✓        —

WordPress puts tags and categories on each post's <article>, so every inline <code> in such a post got language-none, and the themes' :not(pre) > code[class*="language-"] restyled it.

🤖 Generated with Claude Code

Closes #3364

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for dev-prismjs-com ready!

Name Link
🔨 Latest commit 7c680e2
🔍 Latest deploy log https://app.netlify.com/projects/dev-prismjs-com/deploys/6af5ddc728fd40ef3b5706b5
😎 Deploy Preview https://deploy-preview-4202--dev-prismjs-com.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

This branch has not been deployed

No deployments
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

Successfully merging this pull request may close these issues.

CSS selector for language-xxxx class does not account for substrings

1 participant