Skip to content

Commit

Permalink
Highlight bold italic text in headings
Browse files Browse the repository at this point in the history
  • Loading branch information
lggruspe authored and alerque committed Sep 20, 2023
1 parent 4f87df5 commit 241161e
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 1 deletion.
2 changes: 1 addition & 1 deletion syntax/markdown.vim
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ if get(g:, 'vim_markdown_strikethrough', 0)
HtmlHiLink mkdStrike htmlStrike
endif

syn cluster mkdHeadingContent contains=htmlItalic,htmlBold,mkdLink,mkdInlineURL
syn cluster mkdHeadingContent contains=htmlItalic,htmlBold,htmlBoldItalic,mkdLink,mkdInlineURL
syn cluster mkdNonListItem contains=@htmlTop,htmlItalic,htmlBold,htmlBoldItalic,mkdFootnotes,mkdInlineURL,mkdLink,mkdLinkDef,mkdLineBreak,mkdBlockquote,mkdCode,mkdRule,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6,mkdMath,mkdStrike

"highlighting for Markdown groups
Expand Down
64 changes: 64 additions & 0 deletions test/syntax.vader
Original file line number Diff line number Diff line change
Expand Up @@ -1430,3 +1430,67 @@ Given markdown;
Execute (asterisk bold text in setext headings):
AssertEqual SyntaxOf('h1'), 'htmlBold'
AssertEqual SyntaxOf('h2'), 'htmlBold'

Given markdown;
# ___h1___

## ___h2___

### ___h3___

#### ___h4___

##### ___h5___

###### ___h6___

Execute (underscore bold italic text in atx headings):
AssertEqual SyntaxOf('h1'), 'htmlBoldItalic'
AssertEqual SyntaxOf('h2'), 'htmlBoldItalic'
AssertEqual SyntaxOf('h3'), 'htmlBoldItalic'
AssertEqual SyntaxOf('h4'), 'htmlBoldItalic'
AssertEqual SyntaxOf('h5'), 'htmlBoldItalic'
AssertEqual SyntaxOf('h6'), 'htmlBoldItalic'

Given markdown;
# ***h1***

## ***h2***

### ***h3***

#### ***h4***

##### ***h5***

###### ***h6***

Execute (asterisk bold italic text in atx headings):
AssertEqual SyntaxOf('h1'), 'htmlBoldItalic'
AssertEqual SyntaxOf('h2'), 'htmlBoldItalic'
AssertEqual SyntaxOf('h3'), 'htmlBoldItalic'
AssertEqual SyntaxOf('h4'), 'htmlBoldItalic'
AssertEqual SyntaxOf('h5'), 'htmlBoldItalic'
AssertEqual SyntaxOf('h6'), 'htmlBoldItalic'

Given markdown;
___h1___
=

___h2___
-

Execute (underscore bold italic text in setext headings):
AssertEqual SyntaxOf('h1'), 'htmlBoldItalic'
AssertEqual SyntaxOf('h2'), 'htmlBoldItalic'

Given markdown;
***h1***
=

***h2***
-

Execute (asterisk bold italic text in setext headings):
AssertEqual SyntaxOf('h1'), 'htmlBoldItalic'
AssertEqual SyntaxOf('h2'), 'htmlBoldItalic'

0 comments on commit 241161e

Please sign in to comment.