Fix bold and italic markdown syntax

This commit is contained in:
Rane 2019-03-14 14:03:42 -06:00
parent 54d1a997d9
commit e26d9fdb8e

View File

@ -13,23 +13,21 @@ let s:markdown_syntax = g:vimwiki_syntax_variables['markdown']
let s:markdown_syntax.rxEqIn = '\$[^$`]\+\$' let s:markdown_syntax.rxEqIn = '\$[^$`]\+\$'
let s:markdown_syntax.char_eqin = '\$' let s:markdown_syntax.char_eqin = '\$'
" text: *strong* " text: **strong** or __strong__
" let s:markdown_syntax.rxBold = '\*[^*]\+\*'
let s:markdown_syntax.rxBold = '\%(^\|\s\|[[:punct:]]\)\@<='. let s:markdown_syntax.rxBold = '\%(^\|\s\|[[:punct:]]\)\@<='.
\'\*'. \'\(\*\|_\)\{2\}'.
\'\%([^*`[:space:]][^*`]*[^*`[:space:]]\|[^*`[:space:]]\)'. \'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'.
\'\*'. \'\1\{2\}'.
\'\%([[:punct:]]\|\s\|$\)\@=' \'\%([[:punct:]]\|\s\|$\)\@='
let s:markdown_syntax.char_bold = '*' let s:markdown_syntax.char_bold = '\*\*\|__'
" text: _emphasis_ " text: _emphasis_ or *emphasis*
" let s:markdown_syntax.rxItalic = '_[^_]\+_'
let s:markdown_syntax.rxItalic = '\%(^\|\s\|[[:punct:]]\)\@<='. let s:markdown_syntax.rxItalic = '\%(^\|\s\|[[:punct:]]\)\@<='.
\'_'. \'\(\*\|_\)'.
\'\%([^_`[:space:]][^_`]*[^_`[:space:]]\|[^_`[:space:]]\)'. \'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'.
\'_'. \'\1'.
\'\%([[:punct:]]\|\s\|$\)\@=' \'\%([[:punct:]]\|\s\|$\)\@='
let s:markdown_syntax.char_italic = '_' let s:markdown_syntax.char_italic = '\*\|_'
" text: *_bold italic_* or _*italic bold*_ " text: *_bold italic_* or _*italic bold*_
let s:markdown_syntax.rxBoldItalic = '\%(^\|\s\|[[:punct:]]\)\@<='. let s:markdown_syntax.rxBoldItalic = '\%(^\|\s\|[[:punct:]]\)\@<='.