Permalink
Browse files

Merge pull request #20 from bdesham/fix-backticks

Fix incorrect treatment of bold/italic/code spans with only one character enclosed
  • Loading branch information...
2 parents ddf7ad4 + c36500e commit 8068cf31b2c16c09e98ae63f3351534bcae22fc6 Hallison Batista committed Nov 30, 2011
Showing with 6 additions and 7 deletions.
  1. +6 −7 syntax/markdown.vim
View
@@ -36,12 +36,11 @@ syntax case ignore
syntax sync linebreaks=1
" Additions to HTML groups
-syntax region htmlBold start=/\\\@<!\(^\|\A\)\@=\*\@<!\*\*\*\@!\S/ end=/\S\\\@<!\*\@<!\*\*\*\@!\($\|\A\)\@=/ contains=htmlItalic,@Spell
+syntax region htmlBold start=/\\\@<!\(^\|\A\)\@=\*\@<!\*\*\*\@!\S\@=/ end=/\S\\\@<!\*\@<!\*\*\*\@!\($\|\A\)\@=/ contains=htmlItalic,@Spell
-
-syntax region htmlItalic start=/\\\@<!\(^\|\A\)\@=\*\@<!\*\*\@!\S/ end=/\S\\\@<!\*\@<!\*\*\@!\($\|\A\)\@=/ contains=htmlBold,@Spell
-syntax region htmlItalic start=/\\\@<!\(^\|\A\)\@=\<_\@<!___\@!\S/ end=/\S\\\@<!_\@<!___\@!\($\|\A\)\@=/ contains=htmlBold,@Spell
-syntax region htmlItalic start=/\\\@<!\(^\|\A\)\@=\<_\@<!__\@!\S/ end=/\S\\\@<!_\@<!__\@!\($\|\A\)\@=/ contains=htmlBold,@Spell
+syntax region htmlItalic start=/\\\@<!\(^\|\A\)\@=\*\@<!\*\*\@!\S\@=/ end=/\S\\\@<!\*\@<!\*\*\@!\($\|\A\)\@=/ contains=htmlBold,@Spell
+syntax region htmlItalic start=/\\\@<!\(^\|\A\)\@=\<_\@<!___\@!\S\@=/ end=/\S\\\@<!_\@<!___\@!\($\|\A\)\@=/ contains=htmlBold,@Spell
+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
@@ -68,8 +67,8 @@ 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 match mkdLineBreak / \+$/
+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>"

0 comments on commit 8068cf3

Please sign in to comment.