Open tfoerst3r opened 5 years ago
Encountered the same issue today. I tested how pandoc would treat such cases:
pandoc -o test.pdf test.md
I found, when #indent-space is <= 3, then pandoc will recognize them as valid code block construction. When #indent-space >= 4, then pandoc will treat them as typewriter text. It makes sense.
Yet, the current vim-pandoc-syntax recognizes constructions with >=4 leading spaces as code blocks. I think maybe the logic is somehow flipped.
Dear @randomizedthinking, so it should read
syn match pandocCodeblock /\([ ]\{1,3}.*$/
? What about tabs?
@Konfekt the code is not the one you just mentioned. In EnableEmbedsforCodeblocksWithLang
, a syn region is defined for each lang: pandocDelimitedCodeBlock
.
Personally I would prefer if indented blocks weren't highlighted, because false positives are far more annoying than false negatives. If you crave highlighting of code blocks fenced blocks with language appropriate highlighting are available.
There is at
" syntax/pandoc.vim (lines 290-292)
if g:pandoc#syntax#protect#codeblocks == 1
syn match pandocCodeblock /\([ ]\{4}\|\t\).*$/
endif
the undocumented option g:pandoc#syntax#protect#codeblocks
that switches highlighting of indented code blocks off by setting it to 0
.
@Icy-Thought You have a completely different issue than what is being discussed in this issue and it will require a different fix. Can you please open that as a separate issue so we can track it properly?
@bpj What kind of false positives worry you? Highlighting the wrong embedded language or Highlighting things that shouldn't be code blocks at all?
Things that aren't code blocks at all, namely list item continuation paragraphs.
-- Better --help|less than helpless
Den tis 9 juni 2020 18:50Caleb Maclennan notifications@github.com skrev:
@bpj https://github.com/bpj What kind of false positives worry you? Highlighting the wrong embedded language or Highlighting things that shouldn't be code blocks at all?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vim-pandoc/vim-pandoc-syntax/issues/253#issuecomment-641435049, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAI3OU24XZJE7WRCLVWGQPLRVZR2HANCNFSM4GLBDG4A .
@Icy-Thought You have a completely different issue than what is being discussed in this issue and it will require a different fix. Can you please open that as a separate issue so we can track it properly?
@alerque Deleted it and created a new issue with the mentioned issue to reduce future confusion which could arise from my earlier comment.
Hallo.
It seems to me that indented code blocks (as discussed in Issue #207) are not highlighted correctly (see images blow). I have found no information how to change this. Any help would be appreciated.