-
-
Notifications
You must be signed in to change notification settings - Fork 191
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
Fix indented code block detection and fenced code block categorization #167
Conversation
I'm not sure this is always the case. One can leave blank lines between entries in a list, and one may also have multi-paragraph list items. For instance, in this 4-space indented list: - Parent paragraph 1
Parent paragraph 2*
- Child paragraph 1
Child paragraph 2*
Child code block*
Parent 1 paragraph 3*
Parent code block* I used
The same is true when you consider 2-space indented lists: - Parent paragraph 1
Parent paragraph 2
- Child paragraph 1
Child paragraph 2*
Child code block*
Parent 1 paragraph 3
Parent code block* Rendered like this:
|
@j-hui if I understand you correctly, you are pointing out that fix misses some cases, and not that it breaks anything that wasn't automatically broken. If so, this is helpful to know, but not a deal breaker for merging. On that I note, I am especially loathe to merge any vim-markdown PR without fully vetting it, because the potential for regressions is so damn high, but given that this is literally a one line change, I feel confident I fully understand it and am willing to merge. @zhimsel Can you ditch the "last changed at" update? I only update that line when submitting upstream to appease Bram. Changing it in every commit makes commands like |
@tpope yeah, I don't think this will break anything not alrready broken, i.e., it won't highlight anything not already highlighted as a code block. |
Ha, understandable. |
Prior to this commit, _any_ line that started with at least 4 spaces or a tab would be considered a code block. For example, the third level of a 2-space-indented list would be highlighted as code, not as list items. Note: this conforms to the original Markdown spec: > To produce a code block in Markdown, simply indent every line of the > block by at least 4 spaces or 1 tab. > A code block continues until it reaches a line that is not indented > (or the end of the article). While this doesn't explicitly state that a blank line _before_ the code block is required, in practical testing, it is. As such, I've included the requirement of a blank line preceeding the indent to match the region start. Any line not indented by at least 4 spaces will end the region. Closes tpope#81 Closes tpope#164 Closes tpope#94 (possibly) Closes tpope#140
Given that there are two separate syntax groups for code and code blocks, it makes sense to have the triple-backtick/tilde fenced code blocks be labeled as such.
b8a4935
to
3ddee79
Compare
The custom syntax file is no longer needed, now that tpope/vim-markdown#167 has been merged. Until neovim/vim update their builtin syntax files against this, the plugin needs to be sourced directly.
Please see individual commit messages for more detailed notes.
Happy to address any feedback and RFCs.
Closes #81
Closes #164
Closes #94 (possibly)
Closes #140