Skip to content

Commit 0024900

Browse files
bwhelmalerque
authored andcommitted
Fix interference between simple tables and unordered lists
Closes #193 It's possible to have empty unordered list items like this: - - Currently when there are at least two list items with at least one of them being empty, pandoc-syntax interprets these as tables and hides the empty item and all sub-items, empty or not, as well as some other non-empty items at the same level. This patch requires simple tables to be have dashed lines where each group of dashes contains at least 2 hyphens, thus eliminating the clash with empty unordered lists.
1 parent b4a08ef commit 0024900

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

syntax/pandoc.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,13 +349,13 @@ syn match pandocLineBlockDelimiter /^|/ contained containedin=pandocLineBlock
349349

350350
" Simple: {{{3
351351

352-
syn region pandocSimpleTable start=/\%#=2\(^.*[[:graph:]].*\n\)\@<!\(^.*[[:graph:]].*\n\)\(-\+\s*\)\+\n\n\@!/ end=/\n\n/ containedin=ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend
352+
syn region pandocSimpleTable start=/\%#=2\(^.*[[:graph:]].*\n\)\@<!\(^.*[[:graph:]].*\n\)\(-\{2,}\s*\)\+\n\n\@!/ end=/\n\n/ containedin=ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend
353353
syn match pandocSimpleTableDelims /\-/ contained containedin=pandocSimpleTable
354354
syn match pandocSimpleTableHeader /\%#=2\(^.*[[:graph:]].*\n\)\@<!\(^.*[[:graph:]].*\n\)/ contained containedin=pandocSimpleTable
355355

356-
syn region pandocTable start=/\%#=2^\(-\+\s*\)\+\n\n\@!/ end=/\%#=2^\(-\+\s*\)\+\n\n/ containedin=ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend
356+
syn region pandocTable start=/\%#=2^\(-\{2,}\s*\)\+\n\n\@!/ end=/\%#=2^\(-\{2,}\s*\)\+\n\n/ containedin=ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend
357357
syn match pandocTableDelims /\-/ contained containedin=pandocTable
358-
syn region pandocTableMultilineHeader start=/\%#=2\(^-\+\n\)\@<=./ end=/\%#=2\n-\@=/ contained containedin=pandocTable
358+
syn region pandocTableMultilineHeader start=/\%#=2\(^-\{2,}\n\)\@<=./ end=/\%#=2\n-\@=/ contained containedin=pandocTable
359359

360360
" }}}3
361361
" Grid: {{{3

0 commit comments

Comments
 (0)