vim-markdown
vim-markdown copied to clipboard
Incorrect processing of "_"
"_" is a underscore. This is _undeline_.
Result: "_" is a underscore. This is undeline.
But with vim-markdown:

Can you tell me how #16 works for you? I never got around to thoroughly evaluating it.
I think this issue is a duplicate of #27.
Another underscore issue:

Notice the italics, but these are not (and should not be rendered):

It appears that Github's parser now agrees with vim-markdown's, which is unfortunate I think.

Yeah this stuff is super flaky and implementation dependent. If you're writing markdown, you should just always escape underscores to be safe. I'm open to improvements in the highlighting but I don't think there's a "correct" solution.
I agree that I don't think there's a correct solution. I do however find highlighting an internal underscore as an error to be quite distracting. I disabled this behaviour with the following patch:
diff --git a/markdown.vim.orig b/markdown.vim
index 068115e..030fcdb 100644
--- a/markdown.vim.orig
+++ b/markdown.vim
@@ -93,7 +93,7 @@ if main_syntax ==# 'markdown'
endif
syn match markdownEscape "\\[][\\`*_{}()#+.!-]"
-syn match markdownError "\w\@<=_\w\@="
+syn match markdownError "\w\@<=\w\@="
hi def link markdownH1 htmlH1
hi def link markdownH2 htmlH2