diff --git a/syntax/markdown.vim b/syntax/markdown.vim index e19adda1..37494832 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -156,7 +156,7 @@ if get(g:, 'vim_markdown_strikethrough', 0) HtmlHiLink mkdStrike htmlStrike endif -syn cluster mkdHeadingContent contains=htmlItalic,htmlBold,htmlBoldItalic,mkdFootnotes,mkdLink,mkdInlineURL +syn cluster mkdHeadingContent contains=htmlItalic,htmlBold,htmlBoldItalic,mkdFootnotes,mkdLink,mkdInlineURL,mkdStrike 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 diff --git a/test/strikethrough.vader b/test/strikethrough.vader new file mode 100644 index 00000000..4fe392ab --- /dev/null +++ b/test/strikethrough.vader @@ -0,0 +1,41 @@ +Before: + let g:vim_markdown_strikethrough = 1 + syn off | syn on + +After: + unlet! g:vim_markdown_strikethrough + +Given markdown; +a ~~b~~ c + +Execute (strikethrough): + AssertNotEqual SyntaxOf('a'), 'mkdStrike' + AssertEqual SyntaxOf('b'), 'mkdStrike' + AssertNotEqual SyntaxOf('c'), 'mkdStrike' + +Given markdown; +# ~~h1~~ +## ~~h2~~ +### ~~h3~~ +#### ~~h4~~ +##### ~~h5~~ +###### ~~h6~~ + +Execute (strikethrough in atx headings): + AssertEqual SyntaxOf('h1'), 'mkdStrike' + AssertEqual SyntaxOf('h2'), 'mkdStrike' + AssertEqual SyntaxOf('h3'), 'mkdStrike' + AssertEqual SyntaxOf('h4'), 'mkdStrike' + AssertEqual SyntaxOf('h5'), 'mkdStrike' + AssertEqual SyntaxOf('h6'), 'mkdStrike' + +Given markdown; +~~h1~~ += + +~~h2~~ +- + +Execute (strikethrough in setext headings): + AssertEqual SyntaxOf('h1'), 'mkdStrike' + AssertEqual SyntaxOf('h2'), 'mkdStrike'