vimwiki

Personal wiki for vim
git clone https://github.com/vimwiki/vimwiki.git
Log | Files | Refs | README | LICENSE

commit e26d9fdb8efb2b6d345595981972809ffd1f3b3c
parent 54d1a997d91198ddf9622feedc9f0add4e76e169
Author: Rane <rane.brown@gmail.com>
Date:   Thu, 14 Mar 2019 14:03:42 -0600

Fix bold and italic markdown syntax

Diffstat:
Msyntax/vimwiki_markdown.vim | 22++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)

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