Skip to content

Fix InlineCodeHighlight styling and unknown-language fallback#704

Merged
AnnMarieW merged 3 commits intosnehilvj:masterfrom
antonymilne:master
Mar 23, 2026
Merged

Fix InlineCodeHighlight styling and unknown-language fallback#704
AnnMarieW merged 3 commits intosnehilvj:masterfrom
antonymilne:master

Conversation

@antonymilne
Copy link
Copy Markdown
Contributor

@antonymilne antonymilne commented Mar 19, 2026

Hello! A vizro user noticed some weird behaviour that I've eventually traced back to two small bugs in dmc.InlineCodeHighlight. This PR hopefully fixes both 🤞 I haven't updated any tests so please let me know if that's required!

Here's an example app to show the bugs.

When you click the button you'll see:

  • Style change of inline code: it uses default styling at first (because there's missing dmc-code.css) and when you click the button, the CodeHighlight block loads and injects dmc-code.css, so the inline code style suddenly changes.
  • Italic VAR in ENV_VAR_NAME: unknown languages were highlighted as markdown, so you get unwanted syntax highlighting instead of plain text

before

Here's what happens after the fix: the style of the inline code is correct from the beginning (no italic for unknown language) and doesn't change when you click the button.
after

@AnnMarieW
Copy link
Copy Markdown
Collaborator

Hi @antonymilne

Thanks so much for reporting the issue and providing the fix! 🚀

This works great. We don't have a test for this, as we typically focus on tests for dash callbacks or props that are only in dmc and not Mantine. If you would like to add a test, it would be welcomed, but not required.

Just need to add a changelog entry before merging.

Thanks again!

@antonymilne
Copy link
Copy Markdown
Contributor Author

Hi @AnnMarieW, no worries! I've added a changelog now. I thought for a while about tests and couldn't figure out a very valuable way to do it for these changes so didn't add any, hope that's ok. 🙂

Do you know when this might be released?

@AnnMarieW
Copy link
Copy Markdown
Collaborator

Thanks @antonymilne 💃

I should be able to get the next release done this week.

@AnnMarieW AnnMarieW merged commit 077ec7a into snehilvj:master Mar 23, 2026
1 check passed
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.

2 participants