Feature: Markdown: Support SetExt Heading (Issue #209)

Like these
==========

See: https://spec.commonmark.org/0.29/#setext-headings

Note: work for follow_link and VimwikiTOC
This commit is contained in:
Tinmarino
2020-08-04 00:44:01 -04:00
parent 40f02293bf
commit fc056cfeca
8 changed files with 202 additions and 26 deletions

View File

@ -638,6 +638,7 @@ function! vimwiki#vars#populate_syntax_vars(syntax) abort
\ '^\s*\('.header_symbol.'\{1,6}\)\zs[^'.header_symbol.'].*[^'.header_symbol.']\ze\1\s*$'
else
" asymmetric
" Note: For markdown rxH=# and asymetric
for i in range(1,6)
let syntax_dic['rxH'.i.'_Template'] =
\ repeat(header_symbol, i).' __Header__'
@ -650,8 +651,11 @@ function! vimwiki#vars#populate_syntax_vars(syntax) abort
let syntax_dic['rxH'.i.'_End'] =
\ '^\s*'.header_symbol.'\{1,'.i.'}[^'.header_symbol.'].*$'
endfor
let syntax_dic.rxHeader =
\ '^\s*\('.header_symbol.'\{1,6}\)\zs[^'.header_symbol.'].*\ze$'
" Define header regex
" -- ATX heading := preceed by #*
let atx_heading = '^\s*\%('.header_symbol.'\{1,6}\)'
let atx_heading .= '\zs[^'.header_symbol.'].*\ze$'
let syntax_dic.rxHeader = atx_heading
endif
let syntax_dic.rxPreStart =