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

Incorrect processing of "_" #37

Open
kossnocorp opened this issue Apr 8, 2013 · 6 comments
Open

Incorrect processing of "_" #37

kossnocorp opened this issue Apr 8, 2013 · 6 comments

Comments

@kossnocorp
Copy link

"_" is a underscore. This is _undeline_.

Result: "_" is a underscore. This is undeline.

But with vim-markdown:

Screen Shot 2013-04-08 at 12 17 17 PM

@tpope
Copy link
Owner

tpope commented Apr 11, 2013

Can you tell me how #16 works for you? I never got around to thoroughly evaluating it.

@positron
Copy link

I think this issue is a duplicate of #27.

@smackesey
Copy link

Another underscore issue:

screen shot 2014-01-09 at 3 02 21 pm

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

screen shot 2014-01-09 at 3 04 35 pm

@calebhearth
Copy link

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

2014-03-14 at 3 02 pm

@tpope
Copy link
Owner

tpope commented Mar 14, 2014

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.

@sjackman
Copy link

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

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

No branches or pull requests

6 participants