vim-pandoc / vim-pandoc-legacy

[UNSUPPORTED/use vim-pandoc/vim-pandoc] vim bundle for pandoc users
143 stars 23 forks source link

Hard line breaks incorrectly highlighted within emphasized text #111

Closed kylebarbour closed 10 years ago

kylebarbour commented 10 years ago

When within emphases (* or _), hard line breaks are formatted as \\ rather then as . For example, the lines

*I have eaten \\
the plums \\
that were in \\
the icebox*

are highlighted, but the the linebreaks are incorrectly rendered as

I have eaten \\
the plums \\
that were in \\
the icebox

rather than

I have eaten \↵
the plums \↵
that were in \↵
the icebox
kylebarbour commented 10 years ago

I think that this is a contains issue. Adding pandocNewlines to the contains in the emphasis call s:WithConceal lines seems to solve this problem:

call s:WithConceal("block", 'syn region pandocEmphasis matchgroup=Operator start=/\(\_^\|\s\|[[:punct:]]\)\@<=\*/ skip=/\(\*\*\|__\)/ end=/\*\([[:punct:]]\|\s\|\_$\)\@=/ contains=@Spell,pandocNewline', 'concealends')
call s:WithConceal("block", 'syn region pandocEmphasis matchgroup=Operator start=/\(\_^\|\s\|[[:punct:]]\)\@<=_\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@<=_\([[:punct:]]\|\s\|\_$\)\@=/ contains=@Spell,pandocNewline', 'concealends')
fmoralesc commented 10 years ago

Sorry not to have noticed this before. I'm including this in vim-pandoc-syntax.