-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Headings H3 - H6 are assigned incorrect textmate scopes #483
Comments
Looks like the issue is upstream in https://github.com/wooorm/markdown-tm-language, should be an easy fix? H3 - H6 are already targeted in the TMLanguage file, just not assigned the right IDs |
PR is in to hopefully fix this at wooorm/markdown-tm-language#12 |
Hi! Have you tested that your changes work with GitHub and some common/default VS Code themes? Often, themes don’t support all scopes. |
I think for GH this will be fine. That’s just looking at |
It might be interesting to know of this breaks any things. But even if this breaks a theme, this change makes sense IMO. Themes can adapt. |
Is there a reason H3 - H6 were assigned H2 scopes? |
I don’t remember. Hence the question.
GH doesn’t. There are several workarounds for GH. That’s the most important. As for VS Code defaults: that’s chicken and egg. At this point this grammar is not too often used. So it is less likely that VS Code changes things. But theoretically I’d agree with you. Also: this can be used in many places. TextMate. Sublime. Anywhere. Some compatibility between existing things is nice. We can’t expect every software to change. |
Okay so after looking a fair amount I can't really see anything that is explicitly relying on H3 - H6 all having H2 scope, but some that already rely on headings having the correct scope that get broken in MDX. For example, Catppuccin Frappe from Catppuccin for VSCode Searching for files not using deeper headings shows that pretty much repo that references H2 scopes and not any deeper ones is just bundling https://github.com/wooorm/markdown-tm-language instead of doing something meaningful with it. Now I can't speak on GitHub, as I don't know where I'd even begin to look for their implementations let alone if they're source available, but from my surface level lookover I can't see anywhere that they'd be relying on this behavior. They seem to not care what level a heading is wherever I look. |
For GH, see my earlier comment #483 (comment). As for source, see e.g. https://github.com/primer/github-syntax-dark/blob/master/lib/github-dark.css. Thanks for checking! |
Ah, I think I missed that comment. Thanks! |
Initial checklist
Affected packages and versions
v1.8.11
Link to runnable example
No response
Steps to reproduce
Ctrl
+Shift
+P
menuExpected behavior
Since H1 is assigned
markup.heading.atx.1
and H2 is assignedmarkup.heading.atx.2
, H3 - H6 should be assignedmarkup.heading.atx.3
,markup.heading.atx.4
, and so on.Actual behavior
H3 - H6 are all assigned
markup.heading.atx.2
.Affected runtime and version
Not sure, it's in the most recent version of VSCode
Affected package manager and version
No response
Affected OS and version
Ubuntu 22.04.5 LTS
Build and bundle tools
No response
The text was updated successfully, but these errors were encountered: