Syntax: Stricter typeface and fix preCode (alias inline) nested in bold
Fix: Syntax bug precode nested in bold apperead bold Problem: 1. `that_ HERE _was` italic 2. `__that ``HERE`` was__ bold => PreCode should not receive typeface region changes Solution: 1. Stricter regex (and add \* to VimwikiError) 2. Add VikiError and WikiPre to nestables syntaxes
This commit is contained in:
@@ -1768,7 +1768,6 @@ endfunction
|
||||
|
||||
" Conceal
|
||||
function! vimwiki#emoji#apply_conceal() abort
|
||||
syn iskeyword 0-9,a-z,A-Z,:-:
|
||||
for [name, emoji] in items(s:emoji_single)
|
||||
exe 'syn keyword VimwikiEmoji :' . name . ': conceal cchar=' . emoji
|
||||
endfor
|
||||
|
||||
@@ -273,11 +273,11 @@ endfunction
|
||||
" Helper: Expand regex from reduced typeface delimiters
|
||||
" :param: list<list,delimiters>> with reduced regex
|
||||
" Return: list with extended regex delimiters (not inside a word)
|
||||
" -- [['\*_', '_\*']] -> [['\*_\S\@=', '\S\@<=_\*']]
|
||||
" -- [['\*_', '_\*']] -> [['\*_\S\@=', '\S\@<=_\*\%(\s\|$\)\@=']]
|
||||
function! vimwiki#u#hi_expand_regex(lst) abort
|
||||
let res = []
|
||||
for delimiters in a:lst
|
||||
call add(res, [delimiters[0] . '\S\@=', '\S\@<=' . delimiters[1]])
|
||||
call add(res, [delimiters[0] . '\S\@=', '\S\@<=' . delimiters[1] . '\%(\s\|\n\)\@='])
|
||||
endfor
|
||||
return res
|
||||
endfunction
|
||||
@@ -400,5 +400,5 @@ function! vimwiki#u#hi_typeface(dic) abort
|
||||
|
||||
" Prevent var_with_underscore to trigger italic text
|
||||
" -- See $VIMRUNTIME/syntax/markdown.vim
|
||||
syn match VimwikiError "\w\@<=_\w\@="
|
||||
syn match VimwikiError "\w\@<=[_*]\w\@="
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user