Improve typeface specification closer to GFM and test
This commit is contained in:
@@ -319,16 +319,16 @@ function! vimwiki#u#hi_expand_regex(lst) abort
|
||||
let r_left_prefix = '\%(^\|[[:space:]]\@<=\)'
|
||||
let r_left_prefix = '\\\@<!'
|
||||
" -- not followed by Unicode whitespace,
|
||||
let r_left_suffix = '\%([^[:space:]]\@=\)'
|
||||
let r_left_suffix = '\%([[:space:]\n]\@!\)'
|
||||
|
||||
" Left Case1: not followed by punctuation
|
||||
let r_left_suffix1 = '\%(\%([^[:space:]' . punctuation . ']\)\@=\)'
|
||||
let r_left_suffix1 = '\%(\%([[:space:]\n' . punctuation . ']\)\@!\)'
|
||||
" -- Can escape the leftflank
|
||||
let r_left_prefix1 = '\%(^\|\\\@<!\)'
|
||||
|
||||
" Left Case2: followed by punctuation so must be preceded by Unicode whitespace or start of line or a punctuation character.
|
||||
let r_left_suffix2 = '\%([' . punctuation . ']\@=\)'
|
||||
let r_left_prefix2 = '\%(\%(^\|[[:space:]' . punctuation . ']\)\@<=\)'
|
||||
let r_left_prefix2 = '\%(\%(^\|[[:space:]\n' . punctuation . ']\)\@<=\)'
|
||||
|
||||
" Left Concatenate
|
||||
let r_start = '\%(' . r_left_prefix1 . r_left_del . r_left_suffix1
|
||||
|
||||
@@ -752,10 +752,21 @@ function! s:get_markdown_syntaxlocal() abort
|
||||
\ 'post_mark': '\%(`\{3,}\|\~\{3,}\)'}},
|
||||
\ 'symH': {'type': type(0), 'default': 0},
|
||||
\ 'typeface': {'type': type({}), 'default': {
|
||||
\ 'bold': vimwiki#u#hi_expand_regex([['__', '__'], ['\*\*', '\*\*']]),
|
||||
\ 'italic': vimwiki#u#hi_expand_regex([['\*', '\*'], ['_', '_']]),
|
||||
\ 'bold': vimwiki#u#hi_expand_regex([
|
||||
\ ['\%(\\\@<!_\)\@<!__\%(\\\@<!_\)\@!', '\%(\\\@<!_\)\@<!__\%(\\\@<!_\)\@!'],
|
||||
\ ['\%(\\\@<!\*\)\@<!\*\*\%(\\\@<!\*\)\@!', '\%(\\\@<!\*\)\@<!\*\*\%(\\\@<!\*\)\@!'],
|
||||
\ ]),
|
||||
\ 'italic': vimwiki#u#hi_expand_regex([
|
||||
\ ['\%(\\\@<!\*\)\@<!\*\%(\\\@<!\*\)\@!', '\%(\\\@<!\*\)\@<!\*\%(\\\@<!\*\)\@!'],
|
||||
\ ['\%(\\\@<!_\)\@<!_\%(\\\@<!_\)\@!', '\%(\\\@<!_\)\@<!_\%(\\\@<!_\)\@!'],
|
||||
\ ]),
|
||||
\ 'underline': vimwiki#u#hi_expand_regex([]),
|
||||
\ 'bold_italic': vimwiki#u#hi_expand_regex([['\*_', '_\*'], ['_\*', '\*_'], ['\*\*\*', '\*\*\*'], ['___', '___']]),
|
||||
\ 'bold_italic': vimwiki#u#hi_expand_regex([
|
||||
\ ['\*_', '_\*'],
|
||||
\ ['_\*', '\*_'],
|
||||
\ ['\%(\\\@<!\*\)\@<!\*\*\*\%(\\\@<!\*\)\@!', '\%(\\\@<!\*\)\@<!\*\*\*\%(\\\@<!\*\)\@!'],
|
||||
\ ['\%(\\\@<!_\)\@<!___\%(\\\@<!_\)\@!', '\%(\\\@<!_\)\@<!___\%(\\\@<!_\)\@!']
|
||||
\ ]),
|
||||
\ 'code': [
|
||||
\ ['\%(^\|[^`\\]\)\@<=`\%($\|[^`]\)\@=',
|
||||
\ '\%(^\|[^`]\)\@<=`\%($\|[^`]\)\@='],
|
||||
|
||||
Reference in New Issue
Block a user