Skip to content

Commit c015764

Browse files
committed
prevent pandocnolabel from being matched in codeblocks
also, disable highlighting of roman numeral lists by default should fix issue #129
1 parent ef97b00 commit c015764

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

syntax/pandoc.vim

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,11 @@ if !exists("g:pandoc#syntax#newlines")
124124
let g:pandoc#syntax#newlines = 1
125125
endif
126126
" }}}
127+
" detect roman-numeral list items? {{{2
128+
if !exists('g:pandoc#syntax#roman_lists')
129+
let g:pandoc#syntax#roman_lists = 0
130+
endif
131+
" }}}
127132
"}}}1
128133

129134
" Functions: {{{1
@@ -244,7 +249,7 @@ else
244249
syn region pandocReferenceURL matchgroup=Operator start=/\]\@1<=(/ end=/)/ keepend display
245250
endif
246251
" let's not consider "a [label] a" as a label, remove formatting - Note: breaks implicit links
247-
syn match pandocNoLabel /\]\@1<!\(\s\+\|^\)\[[^\[\]]\{-}\]\(\s\+\|$\)[\[(]\@!/ contains=pandocPCite
252+
syn match pandocNoLabel /\]\@1<!\(\s\{,3}\|^\)\[[^\[\]]\{-}\]\(\s\+\|$\)[\[(]\@!/ contains=pandocPCite
248253
syn match pandocLinkTip /\s*".\{-}"/ contained containedin=pandocReferenceURL contains=@Spell display
249254
call s:WithConceal("image", 'syn match pandocImageIcon /!\[\@=/ display', 'conceal cchar='. s:cchars["image"])
250255
" }}}
@@ -416,7 +421,9 @@ call s:WithConceal('list', 'syn match pandocUListItemBullet /^>\=\s*\zs[*+-]/ co
416421
" Ordered lists
417422
syn match pandocListItem /^\s*(\?\(\d\+\|\l\|\#\|@\)[.)].*$/ nextgroup=pandocListItem,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocDelimitedCodeBlock,pandocListItemContinuation contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocAutomaticLink skipempty display
418423
" support for roman numerals up to 'c'
419-
syn match pandocListItem /^\s*(\?x\=l\=\(i\{,3}[vx]\=\)\{,3}c\{,3}[.)].*$/ nextgroup=pandocListItem,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocDelimitedCodeBlock,pandocListItemContinuation,pandocAutomaticLink skipempty display
424+
if g:pandoc#syntax#roman_lists != 0
425+
syn match pandocListItem /^\s*(\?x\=l\=\(i\{,3}[vx]\=\)\{,3}c\{,3}[.)].*$/ nextgroup=pandocListItem,pandocMathBlock,pandocLaTeXInlineMath,pandocDelimitedCodeBlock,pandocListItemContinuation,pandocAutomaticLink skipempty display
426+
endif
420427
syn match pandocListItemBullet /^(\?.\{-}[.)]/ contained containedin=pandocListItem
421428
syn match pandocListItemBulletId /\(\d\+\|\l\|\#\|@.\{-}\|x\=l\=\(i\{,3}[vx]\=\)\{,3}c\{,3}\)/ contained containedin=pandocListItemBullet
422429

0 commit comments

Comments
 (0)