From fa07c14220312f708ec88bdbf685c0d02c58f3c4 Mon Sep 17 00:00:00 2001 From: Jonathan Martin Date: Fri, 2 Jan 2015 16:14:06 -0500 Subject: [PATCH] Add tilde-fenced code blocks. --- syntax/mkd.vim | 2 ++ test/syntax.vader | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/syntax/mkd.vim b/syntax/mkd.vim index 011f95e..60a675d 100644 --- a/syntax/mkd.vim +++ b/syntax/mkd.vim @@ -70,6 +70,8 @@ syn region mkdBlockquote start=/^\s*>/ end=/$/ contains=mkdL syn region mkdCode start=/\(\([^\\]\|^\)\\\)\@]*>" end="" syn region mkdCode start="]*>" end="" syn region mkdFootnote start="\[^" end="\]" diff --git a/test/syntax.vader b/test/syntax.vader index b06ddf0..c3dc02d 100644 --- a/test/syntax.vader +++ b/test/syntax.vader @@ -87,6 +87,24 @@ Given mkd; Execute (autolinks can be backslash escaped): AssertNotEqual SyntaxOf('<'), 'mkdDelimiter' +# Code Blocks + +Given mkd; +~~~ +code +~~~ + +Execute (code blocks can be fenced with tildes): + AssertEqual SyntaxOf('c'), 'mkdCode' + +Given mkd; +~~~ruby +code +~~~ + +Execute (code blocks can have a language specifier): + AssertEqual SyntaxOf('c'), 'mkdCode' + # Math Given mkd; -- 2.39.5