@@ -12,22 +12,26 @@ if s:conceal
1212 let s: concealends = ' concealends'
1313endif
1414
15- function s: markup_start (marker) abort
16- let items = [' ^' , ' \s' , ' (' , ' -' , " '" , ' "' , ' {' ] + [a: marker ]
17- return ' #\(' .join (items , ' \|' ).' \)\zs' .a: marker .' #'
15+ function s: markup_start (marker, ... ) abort
16+ let items = [' \s' , ' (' , ' -' , " '" , ' "' , ' {' ]
17+ let alternative = get (a: , 1 , ' ' )
18+ if a: 0 == 0
19+ let items += [a: marker , ' ^' ]
20+ endif
21+ return ' #\(' .join (items , ' \|' ).' \)\zs' .a: marker .alternative.' #'
1822endfunction
1923
2024function s: markup_end (marker) abort
2125 let items = [' $' , ' \s' , ' )' , ' -' , ' \}' , " '" , ' "' , ' :' , ' ;' , ' !' , ' \\' , ' \[' , ' ,' , ' \.' , ' ?' ] + [a: marker ]
2226 return ' #' .a: marker .' \ze\(' .join (items , ' \|' ).' \)#'
2327endfunction
2428
25- exe ' syntax region org_bold matchgroup=org_bold_delimiter start=' .s: markup_start (' \*' ).' end=' .s: markup_end (' \*' ).' keepend oneline contains=@Spell' . s: concealends
26- exe ' syntax region org_italic matchgroup=org_italic_delimiter start=' .s: markup_start (' \/' ).' end=' .s: markup_end (' \/' ).' keepend oneline contains=@Spell' . s: concealends
27- exe ' syntax region org_underline matchgroup=org_underline_delimiter start=' .s: markup_start (' _' ).' end=' .s: markup_end (' _' ).' keepend oneline contains=@Spell' . s: concealends
28- exe ' syntax region org_code matchgroup=org_code_delimiter start=' .s: markup_start (' \~' ).' end=' .s: markup_end (' \~' ).' keepend oneline contains=@Spell' . s: concealends
29- exe ' syntax region org_verbatim matchgroup=org_verbatim_delimiter start=' .s: markup_start (' =' ).' end=' .s: markup_end (' =' ).' keepend oneline contains=@Spell' . s: concealends
30- exe ' syntax region org_strike matchgroup=org_strike_delimiter start=' .s: markup_start (' +' ).' end=' .s: markup_end (' +' ).' keepend oneline contains=@Spell' . s: concealends
29+ exe ' syntax region org_bold matchgroup=org_bold_delimiter start=' .s: markup_start (' \*' , ' \|^\*\ze[^ \*] ' ).' end=' .s: markup_end (' \*' ).' keepend oneline contains=@Spell' . s: concealends
30+ exe ' syntax region org_italic matchgroup=org_italic_delimiter start=' .s: markup_start (' \/' ).' end=' .s: markup_end (' \/' ).' keepend oneline contains=@Spell' . s: concealends
31+ exe ' syntax region org_underline matchgroup=org_underline_delimiter start=' .s: markup_start (' _' ).' end=' .s: markup_end (' _' ).' keepend oneline contains=@Spell' . s: concealends
32+ exe ' syntax region org_code matchgroup=org_code_delimiter start=' .s: markup_start (' \~' ).' end=' .s: markup_end (' \~' ).' keepend oneline contains=@Spell' . s: concealends
33+ exe ' syntax region org_verbatim matchgroup=org_verbatim_delimiter start=' .s: markup_start (' =' ).' end=' .s: markup_end (' =' ).' keepend oneline contains=@Spell' . s: concealends
34+ exe ' syntax region org_strike matchgroup=org_strike_delimiter start=' .s: markup_start (' +' ).' end=' .s: markup_end (' +' ).' keepend oneline contains=@Spell' . s: concealends
3135
3236hi link org_bold_delimiter org_bold
3337hi link org_italic_delimiter org_italic
0 commit comments