Feature: Support for <mark> in Markdown (issue #1261)
This commit is contained in:
@@ -359,7 +359,8 @@ endfunction
|
|||||||
|
|
||||||
function! vimwiki#u#hi_tag(tag_pre, tag_post, syntax_group, contains, ...) abort
|
function! vimwiki#u#hi_tag(tag_pre, tag_post, syntax_group, contains, ...) abort
|
||||||
" Helper: Create highlight region between two tags
|
" Helper: Create highlight region between two tags
|
||||||
" :param: tag <string> example '<b>'
|
" :param: tag_pre <string>: opening tag example '<b>'
|
||||||
|
" :param: tag_post <string>: closing tag example '</b>'
|
||||||
" :param: syntax_group <string> example: VimwikiBold
|
" :param: syntax_group <string> example: VimwikiBold
|
||||||
" :param: contains <string> coma separated and prefixed, default VimwikiHTMLTag
|
" :param: contains <string> coma separated and prefixed, default VimwikiHTMLTag
|
||||||
" :param: (1) <boolean> is contained
|
" :param: (1) <boolean> is contained
|
||||||
|
|||||||
@@ -328,6 +328,13 @@ for [color_key, color_value] in items(color_dic)
|
|||||||
execute cmd
|
execute cmd
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
|
" Html mark tag, feature request in issue #1261
|
||||||
|
let cmd = 'syntax region VimwikiMarkTag matchgroup=VimwikiDelimiterColor'
|
||||||
|
\ . ' start=/<mark>/'
|
||||||
|
\ . ' end=+</mark>+'
|
||||||
|
\ . ' ' . b:vimwiki_syntax_concealends
|
||||||
|
execute cmd
|
||||||
|
|
||||||
|
|
||||||
" Comment: home made
|
" Comment: home made
|
||||||
execute 'syntax match VimwikiComment /'.vimwiki#vars#get_syntaxlocal('comment_regex').
|
execute 'syntax match VimwikiComment /'.vimwiki#vars#get_syntaxlocal('comment_regex').
|
||||||
@@ -417,6 +424,8 @@ hi def link VimwikiUnderlineItalicBold VimwikiBoldItalicUnderline
|
|||||||
hi def link VimwikiCode PreProc
|
hi def link VimwikiCode PreProc
|
||||||
hi def link VimwikiCodeT VimwikiCode
|
hi def link VimwikiCodeT VimwikiCode
|
||||||
|
|
||||||
|
" Mark
|
||||||
|
hi def VimwikiMarkTag term=bold ctermbg=yellow ctermfg=black guibg=yellow guifg=black
|
||||||
hi def link VimwikiPre PreProc
|
hi def link VimwikiPre PreProc
|
||||||
hi def link VimwikiPreT VimwikiPre
|
hi def link VimwikiPreT VimwikiPre
|
||||||
hi def link VimwikiPreDelim VimwikiPre
|
hi def link VimwikiPreDelim VimwikiPre
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
# Issue: #1261: Feature: Support for <mark> in Markdown
|
||||||
|
|
||||||
|
|
||||||
|
Given vimwiki (Single line mark):
|
||||||
|
<mark>Single line</mark>
|
||||||
|
01234567890
|
||||||
|
|
||||||
|
|
||||||
|
Execute (Set syntax markdown):
|
||||||
|
call SetSyntax('markdown')
|
||||||
|
|
||||||
|
|
||||||
|
Execute (Assert all is yaml except after the closing ---):
|
||||||
|
AssertEqual 'VimwikiMarkTag1', GetSyntaxStack(1, 7)[0] . 1
|
||||||
|
AssertEqual '02', len(GetSyntaxStack(2, 7)) . 2
|
||||||
|
|
||||||
|
|
||||||
|
Given vimwiki (Multiple line mark):
|
||||||
|
<mark>Start
|
||||||
|
Multiple
|
||||||
|
Line
|
||||||
|
end</mark>
|
||||||
|
01234567890
|
||||||
|
|
||||||
|
|
||||||
|
Execute (Set syntax markdown):
|
||||||
|
call SetSyntax('markdown')
|
||||||
|
|
||||||
|
|
||||||
|
Execute (Assert all is yaml except after the closing ---):
|
||||||
|
AssertEqual 'VimwikiMarkTag1', GetSyntaxStack(1, 7)[0] . 1
|
||||||
|
AssertEqual 'VimwikiMarkTag2', GetSyntaxStack(2, 2)[0] . 2
|
||||||
|
AssertEqual 'VimwikiMarkTag3', GetSyntaxStack(3, 2)[0] . 3
|
||||||
|
AssertEqual 'VimwikiMarkTag4', GetSyntaxStack(4, 2)[0] . 4
|
||||||
|
AssertEqual '05', len(GetSyntaxStack(5, 7)) . 5
|
||||||
Reference in New Issue
Block a user