Skip to content

Commit 2e7420b

Browse files
anntzerfmoralesc
authored andcommitted
Fix unicode with sub- or superscripts. (#202)
1 parent 68d7249 commit 2e7420b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

syntax/pandoc.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ call s:WithConceal('html_c_e', 'syn match pandocHTMLCommentEnd /-->/ contained',
217217
" Unset current_syntax so the 2nd include will work
218218
unlet b:current_syntax
219219
syn include @LATEX syntax/tex.vim
220-
syn region pandocLaTeXInlineMath start=/\\\@<!\$[[:graph:]]\@=/ end=/\\\@<!\$/ keepend contains=@LATEX
221-
syn region pandocLaTeXInlineMath start=/\\\@<!\\([[:graph:]]\@=/ end=/\\\@<!\\)/ keepend contains=@LATEX
220+
syn region pandocLaTeXInlineMath start=/\v\\@<!\$\S@=/ end=/\v\\@<!\$\d@!/ keepend contains=@LATEX
221+
syn region pandocLaTeXInlineMath start=/\\\@<!\\(\S\@=/ end=/\\\@<!\\)\d\@!/ keepend contains=@LATEX
222222
syn match pandocProtectedFromInlineLaTeX /\\\@<!\${.*}\(\(\s\|[[:punct:]]\)\([^$]*\|.*\(\\\$.*\)\{2}\)\n\n\|$\)\@=/ display
223223
" contains=@LATEX
224224
syn region pandocLaTeXMathBlock start=/\$\$/ end=/\$\$/ keepend contains=@LATEX

tests/latex.pdc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ Age & Frequency \\ \hline
2121

2222
# test
2323

24+
Unicode!
25+
$α^i_i$
26+
$a^{i}_i$
27+
$a^i_{i}$
28+
$a^{i}_{i}$

0 commit comments

Comments
 (0)