diff --git a/doc/pandoc-syntax.txt b/doc/pandoc-syntax.txt index 325b483..7a6069b 100644 --- a/doc/pandoc-syntax.txt +++ b/doc/pandoc-syntax.txt @@ -37,6 +37,8 @@ CONFIGURATION *vim-pandoc-syntax-configuration* - dashes - ellipses - quotes + - squotes + - apostrophe - inlinecode To review what are the rules for, look for the call to |s:WithConceal| in diff --git a/syntax/pandoc.vim b/syntax/pandoc.vim index 0e09029..292a0c0 100644 --- a/syntax/pandoc.vim +++ b/syntax/pandoc.vim @@ -8,6 +8,7 @@ scriptencoding utf-8 " Maintainer: Caleb Maclennan " Contributor: David Sanson " Contributor: Jorge Israel Peña +" Contributor: Rob Muhlestein (twitch.tv/rwxrob) " OriginalAuthor: Jeremy Schultz " Version: 5.0 @@ -264,7 +265,7 @@ syn match pandocTitleBlockTitle /\%^%.*\n/ contained containedin=pandocTitleBloc " }}}2 " Blockquotes: {{{2 -syn match pandocBlockQuote /^\s\{,3}>.*\n\(.*\n\@1.*\n\(.*\n\@1/ contained containedin=pandocEmphasis,pandocStrong,pandocPCite,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocUListItem,pandocNoFormatted " }}}2 @@ -368,11 +369,11 @@ call s:WithConceal('strikeout', 'syn match pandocStrikeoutMark /\~\~/ contained " }}}2 " Headers: {{{2 -syn match pandocAtxHeader /\(\%^\|<.\+>.*\n\|^\s*\n\)\@<=#\{1,6}.*\n/ contains=pandocEmphasis,pandocStrong,pandocNoFormatted,pandocLaTeXInlineMath,pandocEscapedDollar,@Spell,pandocAmpersandEscape,pandocReferenceLabel,pandocReferenceURL display +syn match pandocAtxHeader /\(\%^\|<.\+>.*\n\|^\s*\n\)\@<=#\{1,6}.*\n/ contains=pandocEmphasis,pandocStrong,pandocNoFormatted,pandocLaTeXInlineMath,pandocEscapedDollar,pandocBeginQuote,pandocEndQuote,pandocBeginSQuote,pandocEndSQuote,pandocApostrophe,pandocEllipses,@Spell,pandocAmpersandEscape,pandocReferenceLabel,pandocReferenceURL display syn match pandocAtxHeaderMark /\(^#\{1,6}\|\\\@[[:punct:]]*\)\@<=''[[:blank:][:punct:]\n]\@=/ containedin=pandocEmphasis,pandocStrong,pandocUListItem,pandocListItem,pandocListItemContinuation display', 'conceal cchar=’') +endif +" }}}3 + " Hrule: {{{3 syn match pandocHRule /^\s*\([*\-_]\)\s*\%(\1\s*\)\{2,}$/ display " }}}3 diff --git a/tests/smart.pdc b/tests/smart.pdc new file mode 100644 index 0000000..71a43d3 --- /dev/null +++ b/tests/smart.pdc @@ -0,0 +1,95 @@ +# Smart Punctuation + +# Ellipses ... + +Ellipses ... +---------- + +Ellipses ... +========== + +And then there was ... + +Blah ... blah. + +... and yet. +...and yet. + +* I'm in a bullet... + +Endash -- +---------- + +Endash -- +========== + +And then there was -- + +Blah--blah. +Blah -- blah. + +-- and yet. +--and yet. + +* I'm in a bullet... + +Emdash --- +--------- + +Emdash --- +========== + +And then there was --- + +Blah---blah. +Blah --- blah. + +--- and yet. +---and yet. + +# "Foo" is a thing + +A "Foo" is a thing +------------------ + +A "Foo" is a thing +================== + +Just some "foo" here. +Are you a "foo"? + +"Foo" +*"Foo"* +**"Foo"** +_"Foo"_ +__"Foo"__ +~~"Foo"~~ + +# 'Bar' + +'Bar' +----- + +'Bar' +===== + +Just some 'bar' here. +Are you a 'bar'? + +'Bar' +*'Bar'* +**'Bar'** +_'Bar'_ +__'Bar'__ +~~'Bar'~~ + +# I'd Really Like to Know + +I'd Really Like to Know +----------------------- + +I'd Really Like to Know +======================= + +I'd +'cuz