-
Notifications
You must be signed in to change notification settings - Fork 590
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
[Markdown] Add GitHub Alerts syntax #3892
[Markdown] Add GitHub Alerts syntax #3892
Conversation
|
Block quotes may contain headings, which are not related with normal documentation structure. Thus exclude them from symbol lists and index.
Extended the scope of exclusion to all kinds of headings in block quotes as they are unlikely to represent normal documentation structure. |
Reading through this, maybe change some scope suffixes here from |
Maybe IIRC, only remaining GFM specific expressions are tables and now github alerts. Any other admonation syntax could use exactly the same scopes. Not sure if anyone would want to highlight them different. |
Just a small discrepancy that I noticed: If there is an empty line within an alert block, the alert scope is not applied anymore. But on GitHub, an empty line doesn't close the alert block: Not sure if this was intentionally made different in the syntax to keep the implementation simple, or if it was just missed. |
Fixes sublimehq#3892 (comment) Follow up commit for sublimehq#3892.
* [Markdown] Fix premature block quote termination Fixes #3892 (comment) Follow up commit for #3892. * [Markdown] Remove useless context pushes This commit removes block-quote punctuation contexts from being pushed on stack, which do not have any effect in conjunction with Github Alerts. They are required support multiple > > > markers in front of content, which is not supported by Github Alerts. Due to consuming caption text pushing those contexts does actually nothing, but causing some extra round-trips.
Resolves #3891
This PR proposes to add support for syntax highlighting of GitHub alerts as proposed by #3891.
This PR uses dedicated scopes
markup.heading.alert
andmarkup.quote.alert
to avoid unwanted negative impacts on highlighting in conjunction with legacy color schemes. Dedicated highlighting requires to opt-in via new color scheme rules. Otherwise those blocks keep highlighting as normal block quotes except[!...]
marker being highlighted as normal heading.