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

Correct markdown highlighting of <>& and fenced code bocks #23

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion syntax/markdown.vim
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ syntax spell toplevel
syntax case ignore
syntax sync linebreaks=1

syntax clear htmlError

" Additions to HTML groups
syntax region htmlBold start=/\\\@<!\(^\|\A\)\@=\*\@<!\*\*\*\@!\S/ end=/\S\\\@<!\*\@<!\*\*\*\@!\($\|\A\)\@=/ contains=htmlItalic,@Spell

Expand All @@ -44,7 +46,7 @@ syntax region htmlItalic start=/\\\@<!\(^\|\A\)\@=\<_\@<!___\@!\S/ end=/\S
syntax region htmlItalic start=/\\\@<!\(^\|\A\)\@=\<_\@<!__\@!\S/ end=/\S\\\@<!_\@<!__\@!\($\|\A\)\@=/ contains=htmlBold,@Spell

" [link](URL) | [link][id] | [link][]
syntax region mkdLink matchgroup=mkdDelimiter start="\!\?\[" end="\]\ze\s*[[(]" contains=@Spell nextgroup=mkdURL,mkdID skipwhite
syntax region mkdLink matchgroup=mkdDelimiter start="\!\?\[" end="\]\ze\_s*[[(]" contains=@Spell nextgroup=mkdURL,mkdID skipwhite skipnl
syntax region mkdID matchgroup=mkdDelimiter start="\[" end="\]" contained
syntax region mkdURL matchgroup=mkdDelimiter start="(" end=")" contained

Expand All @@ -69,7 +71,9 @@ syntax match mkdListItem /^\s*\d\+\.\s\+.*\n\(\(^.\+\n\)*\n\?\)\(\(^\(\s\{4}\|
syntax match mkdBlockCode /^\s*\n\(^\(\s\{4}\|\t\).*\n\)\+/
syntax match mkdListCode /^\s*\n\(^\(\s\{8}\|\t{2}\).*\n\)\+/
syntax match mkdLineBreak / \+$/
syntax region mkdCode start=/^``[^`]*/ end=/[^`]*``.*/
syntax region mkdCode start=/\\\@<!`/ end=/\\\@<!`/
syntax region mkdCode start=/^\~\~*[^~]*/ end=/[^~]*\~\~*$/
syntax region mkdCode start=/\s*``[^`]*/ end=/[^`]*``\s*/
syntax region mkdBlockquote start=/^\s*>/ end=/$/ contains=mkdLineBreak,mkdLineContinue,@Spell
syntax region mkdCode start="<pre[^>]*>" end="</pre>"
Expand Down