yzhang-gh / vscode-markdown

Markdown All in One
https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
MIT License
2.93k stars 325 forks source link

Injection selector disables embedding #844

Open AstrickHarren opened 4 years ago

AstrickHarren commented 4 years ago

Hi devs,

I was trying to customize my syntax highlighting by embedding text.html.markdown into my language extension. As a convention, I defined a scope like meta or meta.embedded and include text.html.markdown into it. But the injection selectors in markdown.math-inline and markdown.math-display seem to unselect injections into such scopes, disabling syntax highlighting for katex math.

I assumed you guys disabled meta for a reason, so is there a better naming convention for my scopes in scenarios like this?

yzhang-gh commented 4 years ago

I have to admit I have limited knowledge of TmLanguage. Perhaps we need to ask @linsui for some advice (#254).

linsui commented 4 years ago

Hi. IIRC, when I filed #254 I unselected meta in markdown.math-display so that it will not be injected into meta.paragraph.markdown and other language in fenced blocks. But there are still some cases not covered, such as embeded markdown. Maybe it can be fixed by add meta.embedded.block.markdown to injectionSelector, I'm not sure. I didn't find any documents about it. :joy: