Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions doc/pandoc-syntax.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ CONFIGURATION *vim-pandoc-syntax-configuration*
- quotes
- inlinecode
- inlinemath
- inlinemathdollar

To review what are the rules for, look for the call to |s:WithConceal| in
syntax/pandoc.vim that takes the corresponding rulename as first argument.
Expand Down
11 changes: 7 additions & 4 deletions syntax/pandoc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,15 @@ call s:WithConceal('html_c_e', 'syn match pandocHTMLCommentEnd /-->/ contained',
" Unset current_syntax so the 2nd include will work
unlet b:current_syntax
syn include @LATEX syntax/tex.vim
if index(g:pandoc#syntax#conceal#blacklist, 'inlinemath') == -1
" Can't use WithConceal here because it will mess up all other conceals
" when dollar signs are used normally. It must be skipped entirely if
" inlinemath is blacklisted
" Can't use WithConceal here because it will mess up all other conceals
" when dollar signs are used normally. It must be skipped entirely if
" inlinemath is blacklisted
if index(g:pandoc#syntax#conceal#blacklist, 'inlinemath') == -1 &&
\ index(g:pandoc#syntax#conceal#blacklist, 'inlinemathdollar') == -1
syn region pandocLaTeXInlineMath start=/\v\\@<!\$\S@=/ end=/\v\\@<!\$\d@!/ keepend contains=@LATEX
syn region pandocLaTeXInlineMath start=/\\\@<!\\(/ end=/\\\@<!\\)/ keepend contains=@LATEX
elseif index(g:pandoc#syntax#conceal#blacklist, 'inlinemath') == -1
syn region pandocLaTeXInlineMath start=/\\\@<!\\(/ end=/\\\@<!\\)/ keepend contains=@LATEX
endif
syn match pandocEscapedDollar /\\\$/ conceal cchar=$
syn match pandocProtectedFromInlineLaTeX /\\\@<!\${.*}\(\(\s\|[[:punct:]]\)\([^$]*\|.*\(\\\$.*\)\{2}\)\n\n\|$\)\@=/ display
Expand Down