-
Notifications
You must be signed in to change notification settings - Fork 588
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] Sync with MarkdownEditing 3.1.1 #3167
[Markdown] Sync with MarkdownEditing 3.1.1 #3167
Conversation
Fixes sublimehq#1930 Fixes sublimehq#2542 Fixes sublimehq#2857 Fixes sublimehq#3073 Fixes sublimehq#3154 Fixes sublimehq#3157 This commit proposes to apply refactored Markdown syntax from MarkdownEditing, which was originally been based on ST's default Markdown syntax. It is mainly a reorganization of existing contexts/patterns, which include several fixes which have been applied during refactoring. It does not yet introduce branching to a broader extend in order to limit changes to the syntax test file. Those are planned for future PRs after being developed and tested in MarkdownEditing repo. Note: 1. All 3rd-party syntaxes or extensions have been removed. 2. For details about single changes, please follow MarkdownEditing's commit history. All syntax related commits start with "Syntax: ".
ebf80a8
to
e2f597f
Compare
This commit reorganizes fenced syntax completions by package and adds those which have been added by syncing with MarkdownEditing.
This commit renames some contexts to plural to express non-popping behavior.
cba52d1
to
7023250
Compare
@deathaxe maybe mark this as significant? |
The significant changes are not yet part of this PR ;-) |
Fixes sublimehq#2942 Fixes sublimehq#3170 This commit proposes to apply refactored Markdown syntax from MarkdownEditing 3.1.1, which was originally been based on ST's default Markdown syntax. This commit fixes various compatibility issues with CommonMark and adds all related test cases of value to prove compliance from https://spec.commonmark.org/0.30/spec.json. Main changes are: * fix regression with latex block highlighting in list items * fix CommonMark compatibility of backslash escapes * fix CommonMark compatibility of block quotes * fix CommonMark compatibility of html entities * fix CommonMark compatibility of fenced code blocks * fix CommonMark compatibility of indented code blocks (mixed tabs/spaces) * fix CommonMark compatibility of reference definitions * fix CommonMark compatibility of thematic breaks * update strikethough markup to use 2 tildes It does not yet introduce branching to a broader extend in order to limit changes to the syntax test file. Those are planned for future PRs after being developed and tested in MarkdownEditing repo. Note: 1. All 3rd-party syntaxes or extensions have been removed. 2. For details about single changes, please follow MarkdownEditing's commit history. All syntax related commits start with "Syntax: ".
Did you want a review now, or will you add more stuff later? |
I don't currently have anything valuable to add in the near future. The next milestone is to introduce sublime-syntax version 2 and rework emphasis (bold, ...) and other things using branching to further improve CommonMark compatibility. But this will take some time, I guess. Feedback about obvious issues would help at any point, of course. The current syntax still suffers some limitations (e.g.: no multiline bold/italics in block quotes), but the solution I have in mind requires some effort based on the branching stuff. |
It is significant in the sense of effort required to review since the changes are huge, not in the effect. |
I would be trying it out already, but it conflicts with the SQL change I need for work 😅 If that gets merged, I'll definitely run this next. |
In which way does it conflict? I've checked out #3046 as well. The required dialect is set via the chooser plugin. |
Yeah, that was it, but the conflict was minimal. I have them both enabled, now. |
This syntax definition is released to the public. So hopefully audience is large enough to get some feedback about issues. Most remarkable changes are related with list blocks, block quotes and preventing indented code blocks from breaking nested lists. Stacking block quotes and lists is somewhat challanging. |
It seems common practice to treat `shell` code blocks as interactive shell. Means each line starting with `$` is treated as shell command, while other lines denote output only, which may not be highlighted.
This commit ensures to start interactive mode not before a line beginning with `$`. Continuation lines start with `>`. Ineractive mode means each line starting with `$` is scoped shell, while everything else is plain text - the output.
In case Shell-Unix-Generic.sublime-syntax is overwritten using another syntax dialect it may happen `no_escape_behind` variable is not defined by a dialect. Hence replace it to avoid future issues.
Maybe now would be a good time to move the test file to |
Wasted time. |
From a quick once-over this seems fine, a review will take some time. |
This PR seems fine after a manual review of the syntax files. I'd appreciate making all |
While "explicit" I find the global |
FWIW No syntax related issue has been opened at https://github.com/SublimeText-Markdown/MarkdownEditing so far. |
My main hesitation with reviewing (apart from the large diff) is the note in the OP making it sound like something was removed but not having concrete details:
Can you elaborate a bit please? Extensions refers to file extensions, or Markdown syntax extensions like footnotes etc.? |
This comment refers to SublimeText-Markdown/MarkdownEditing@f4ef135 and doesn't mean any kind of step backward compared to what ST's Markdown supports at the moment. MarkdownEditing supports ...
It's basically a "normal" refactoring of current Markdown. I just decided to track all the little changes in MDE repo as it was where work started. |
Thanks for the additional input. Maybe you could move that info to the opening comment, i.e. commit message for the merge commit, before merging with master. |
LaTeX blocks ( Test: This might be a reason to add support for them into the core Markdown syntax via another PR. |
open a new issue |
We already have one (see: #3251). But yes, I agree we should just ignore any comment on closed PRs. |
Fixes #1930
Fixes #2542
Fixes #2857
Fixes #2942
Fixes #3073
Addresses #3154 (in ST3 compatible way)
Fixes #3157
Fixes #3170
Addresses #3228
This PR refactors Markdown syntax to
improve compliance with CommonMark specification:
https://spec.commonmark.org/0.30
Many tests are added to proof compliance:
https://spec.commonmark.org/0.30/spec.json
Latest GFM syntax is based on CommonMark at the time writing,
so those rules are included as well:
https://github.github.com/gfm/
convert most anonymous to named contexts for better support
of inheritance.
reorganize syntax into logical sections for better readability
and maintainability.
address most Markdown related issues of sublimehq/Packages repo.
Main changes are:
(mixed tabs/spaces)
Benchmarks:
This commit has no impact on parsing performance.
Notes:
Some remaining CommonMark incompatibilities need further work
using ST4's "branching" feature.
Main refactoring work was done in MarkdownEditing package and
released with version 3.1.1. This commit contains the result
of that work, except some features which rely on 3rd-party
(syntax) packages.
Removed features are:
<kbd>
tag highlighting as it doesn't meetquality expectations