Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Can we highlight double backticks? #14

Closed
johnmhoran opened this issue Sep 4, 2021 · 9 comments
Closed

Can we highlight double backticks? #14

johnmhoran opened this issue Sep 4, 2021 · 9 comments

Comments

@johnmhoran
Copy link

Just installed to test and the highlighting looks very useful. 👍 I see that single backticks (`text`) are nicely highlighted, but double backticks (``text``) are not. Is it possible to add highlighting to double backticks?

@johnmhoran
Copy link
Author

Hmmm. The sample image in #13 shows highlighting for double backticks. My VSCode display does not -- perhaps there's some setting I need to set or change?

@johnmhoran
Copy link
Author

An example:

image

@trond-snekvik
Copy link
Owner

Hi!

This is either a regression or a theme compatibility thing. What theme are you using?

And if you don't mind checking - are single ticks highlighted in markdown files with this theme?

@johnmhoran
Copy link
Author

Hi @trond-snekvik -- thanks for your quick response! Let's see, my VSCode is currently set to 8-Colour-Dark. A few tests (just .rst files atm):

  • Panda Syntax -- double backticks are highlighted but singles no longer are (and headings and some others characters are no longer highlighted).
  • Atom One Dark -- double backticks not highlighted
  • Flatland Monokai -- double backticks not highlighted
  • Dark (Molokai) -- everything is nicely highlighted!
  • Dracula -- everything is nicely highlighted!
  • Visual Studio Dark -- everything is nicely highlighted!
  • Dark+ (default dark) -- everything is nicely highlighted!

As you suspected, I see the connection to the color theme. My guess is there's nothing I can do to "fix" the Panda Syntax incompatibility, for example, but it's easy enough to simply use a theme with full .rst highlighting. Very nice -- makes a visual inspection of a .rst file much easier.

@trond-snekvik
Copy link
Owner

I see.

The syntax highlighting symbol ID is actually the same as the built-in markdown extension uses for single ticks, but it's pretty obscure, and never listed in the docs. I'll see if I can find one that exists in all these themes.

Thanks for the thorough check!

@trond-snekvik
Copy link
Owner

I intend to fix and release this tomorrow, so hopefully you won't have to resort to workarounds, but there is a way to override these type of highlighting issues:

https://code.visualstudio.com/docs/getstarted/themes#_editor-syntax-highlighting

In this case, the scope is markup.inline.raw.string.markdown

@johnmhoran
Copy link
Author

Thank you @trond-snekvik . 👍

@trond-snekvik
Copy link
Owner

Now using the more common string.interpolated symbol scope for monospaced strings. This is available in all the listed themes. There are several other symbols that aren't highlighted in 8-Colour-Dark. Some of them are very common symbols, and I assume this is done on purpose by the theme author, as the theme has a constrained color palette by design.

Fixed the monospaced strings in ec6155f, and did some additional tweaks in 316535b and da987c8 to ensure as rich highlighting as possible in as many themes as possible.

I'd be happy to take additional requests for missing symbol highlights, but I'll close this issue, as all listed themes now highlight the double backticks correctly.

@johnmhoran
Copy link
Author

@trond-snekvik Thank you for making a very useful extension even better. 🚀

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants