Skip to content
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

Multiline lists don't highlight correctly. #81

Closed
jszakmeister opened this issue Sep 6, 2015 · 3 comments · Fixed by #167
Closed

Multiline lists don't highlight correctly. #81

jszakmeister opened this issue Sep 6, 2015 · 3 comments · Fixed by #167

Comments

@jszakmeister
Copy link

I have the following in a markdown file:

* A list

  - A list with a really long entry that spans multiple lines to show the
    error that I'm seeing.

It my case, I'm using two spaces for indentation, which means the start of the second line is on a 4 space boundary. It then renders as code--which can be seen in the screenshot below. I realize it's a painful use-case, but it would be nice to see it fixed.

screen shot 2015-09-06 at 8 48 08 am

@tpope
Copy link
Owner

tpope commented Sep 6, 2015

And now you know the reason code blocks aren't highlighted by default.

@jszakmeister
Copy link
Author

Heh, I see--I have this in my vimfiles:

    " Setup some extra highlighting for code blocks.  This matches the
    " highlighting from Ben William's syntax/mkd.vim and is a decent fallback
    " when we don't support the embedded language or the block is inline.
    highlight default link markdownCode                  String
    highlight default link markdownCodeBlock             String

So that's where the highlighting comes from. But it'd still be nice to have it work correctly. I guess I need to consider disabling the highlighting for now.

@0cjs
Copy link

0cjs commented Apr 12, 2019

I'm having the same problem, and it's really annoying me because I do a lot of meeting minutes in markdown where a substantial part of the document may be list continuation lines indended more than four spaces.

I figured out how to disable highlighting of code blocks (highlight link markdownCodeBlock NONE), but that also disables _italic_, `code` etc. markup in those blocks. Is there a way to turn off code block regions, e.g. by somehow undoing the syn region markdownCodeBlock start=" \|\t" end="$" contained command after it's been executed?

zhimsel added a commit to zhimsel/vim-markdown that referenced this issue Jul 17, 2020
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
tdryer added a commit to tdryer/dotfiles that referenced this issue Dec 30, 2020
This reverts commit 108b555.

Highlighting code blocks shows that multi-line list items aren't parsed
correctly:

tpope/vim-markdown#81
zhimsel added a commit to zhimsel/vim-markdown that referenced this issue Mar 10, 2021
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
tpope pushed a commit that referenced this issue Mar 10, 2021
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 #81
Closes #164
Closes #94 (possibly)
Closes #140
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants