From f18bf3dafb0736c7986c4916f6f903ca24bab1a9 Mon Sep 17 00:00:00 2001 From: Tinmarino Date: Fri, 7 Aug 2020 10:52:12 -0400 Subject: [PATCH] Fix: Html convertion regex Bold and Italic (Issue #977) Problem: I copied rxBold from markdown (mea culpa) Solution: Use the one that was defined in default --- autoload/vimwiki/html.vim | 27 +++++++-------------------- 1 file changed, 7 insertions(+), 20 deletions(-) diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim index f1f1eeb..ff835e1 100644 --- a/autoload/vimwiki/html.vim +++ b/autoload/vimwiki/html.vim @@ -11,32 +11,19 @@ let g:loaded_vimwiki_html_auto = 1 " FIXME: Magics: Why not use the current syntax highlight " This is due to historical copy paste and lazyness of markdown user -" text: **strong** or __strong__ +" text: *strong* +" let s:default_syntax.rxBold = '\*[^*]\+\*' let s:rxBold = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'\(\*\|_\)\{2\}'. - \'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'. - \'\1\{2\}'. + \'\*'. + \'\%([^*`[:space:]][^*`]*[^*`[:space:]]\|[^*`[:space:]]\)'. + \'\*'. \'\%([[:punct:]]\|\s\|$\)\@=' " text: _emphasis_ or *emphasis* let s:rxItalic = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'\(\*\|_\)'. - \'\%([^*_`[:space:]][^*_`]*[^*_`[:space:]]\|[^*_`[:space:]]\)'. - \'\1'. - \'\%([[:punct:]]\|\s\|$\)\@=' - -" Fixme: and those ? are they converted ? -" text: *_bold italic_* or _*italic bold*_ -let rxBoldItalic = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'\(\*\)\{3\}'. - \'\%([^*`[:space:]][^*`]*[^*`[:space:]]\|[^*`[:space:]]\)'. - \'\1\{3\}'. - \'\%([[:punct:]]\|\s\|$\)\@=' - -let rxItalicBold = '\%(^\|\s\|[[:punct:]]\)\@<='. - \'\(_\)\{3\}'. + \'_'. \'\%([^_`[:space:]][^_`]*[^_`[:space:]]\|[^_`[:space:]]\)'. - \'\1\{3\}'. + \'_'. \'\%([[:punct:]]\|\s\|$\)\@='