Skip to content

Commit

Permalink
Fix line-headings with code element
Browse files Browse the repository at this point in the history
  • Loading branch information
KSR-Yasuda committed Jan 18, 2024
1 parent 46add6c commit a46294a
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions syntax/markdown.vim
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,6 @@ syn region mkdLinkTitle matchgroup=mkdDelimiter start=+"+ end=+"+ contained
syn region mkdLinkTitle matchgroup=mkdDelimiter start=+'+ end=+'+ contained
syn region mkdLinkTitle matchgroup=mkdDelimiter start=+(+ end=+)+ contained

"HTML headings
syn region htmlH1 matchgroup=mkdHeading start="^\s*#" end="$" contains=@mkdHeadingContent,@Spell
syn region htmlH2 matchgroup=mkdHeading start="^\s*##" end="$" contains=@mkdHeadingContent,@Spell
syn region htmlH3 matchgroup=mkdHeading start="^\s*###" end="$" contains=@mkdHeadingContent,@Spell
syn region htmlH4 matchgroup=mkdHeading start="^\s*####" end="$" contains=@mkdHeadingContent,@Spell
syn region htmlH5 matchgroup=mkdHeading start="^\s*#####" end="$" contains=@mkdHeadingContent,@Spell
syn region htmlH6 matchgroup=mkdHeading start="^\s*######" end="$" contains=@mkdHeadingContent,@Spell
syn match htmlH1 /^.\+\n=\+$/ contains=@mkdHeadingContent,@Spell
syn match htmlH2 /^.\+\n-\+$/ contains=@mkdHeadingContent,@Spell

"define Markdown groups
syn match mkdLineBreak / \+$/
syn region mkdBlockquote start=/^\s*>/ end=/$/ contains=mkdLink,mkdInlineURL,mkdLineBreak,@Spell
Expand All @@ -117,6 +107,16 @@ syn match mkdRule /^\s*\*\s\{0,1}\*\s\{0,1}\*\(\*\|\s\)*$/
syn match mkdRule /^\s*-\s\{0,1}-\s\{0,1}-\(-\|\s\)*$/
syn match mkdRule /^\s*_\s\{0,1}_\s\{0,1}_\(_\|\s\)*$/

"HTML headings
syn region htmlH1 matchgroup=mkdHeading start="^\s*#" end="$" contains=@mkdHeadingContent,@Spell
syn region htmlH2 matchgroup=mkdHeading start="^\s*##" end="$" contains=@mkdHeadingContent,@Spell
syn region htmlH3 matchgroup=mkdHeading start="^\s*###" end="$" contains=@mkdHeadingContent,@Spell
syn region htmlH4 matchgroup=mkdHeading start="^\s*####" end="$" contains=@mkdHeadingContent,@Spell
syn region htmlH5 matchgroup=mkdHeading start="^\s*#####" end="$" contains=@mkdHeadingContent,@Spell
syn region htmlH6 matchgroup=mkdHeading start="^\s*######" end="$" contains=@mkdHeadingContent,@Spell
syn match htmlH1 /^.\+\n=\+$/ contains=@mkdHeadingContent,@Spell
syn match htmlH2 /^.\+\n-\+$/ contains=@mkdHeadingContent,@Spell

" YAML frontmatter
if get(g:, 'vim_markdown_frontmatter', 0)
syn include @yamlTop syntax/yaml.vim
Expand Down

0 comments on commit a46294a

Please sign in to comment.