Skip to content

Commit

Permalink
Fix ellipsis, start fix for en and em-dash
Browse files Browse the repository at this point in the history
  • Loading branch information
rwxrob authored and alerque committed Feb 14, 2020
1 parent efe6a9a commit ee59c57
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 4 deletions.
6 changes: 3 additions & 3 deletions syntax/pandoc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -501,19 +501,19 @@ endif

" Emdashes: {{{3
if &encoding ==# 'utf-8'
call s:WithConceal('emdashes', 'syn match pandocEllipses /\([^-]\)\@<=---\([^-]\)\@=/ display', 'conceal cchar=—')
call s:WithConceal('emdashes', 'syn match pandocEmdashes /---/ containedin=pandocSetexHeader,pandocEmphasis,pandocStrong,pandocListItem,pandocListItemContinuation,pandocUListItem display', 'conceal cchar=—')
endif
" }}}3

" Endashes: {{{3
if &encoding ==# 'utf-8'
call s:WithConceal('endashes', 'syn match pandocEllipses /\([^-]\)\@<=--\([^-]\)\@=/ display', 'conceal cchar=–')
call s:WithConceal('endashes', 'syn match pandocEndashes /\([^-]\)\@<=--\([^-]\)\@=/ display', 'conceal cchar=–')
endif
" }}}3

" Ellipses: {{{3
if &encoding ==# 'utf-8'
call s:WithConceal('ellipses', 'syn match pandocEllipses /\.\.\./ display', 'conceal cchar=…')
call s:WithConceal('ellipses', 'syn match pandocEllipses /\.\.\./ containedin=pandocEmphasis,pandocStrong,pandocListItem,pandocListItemContinuation,pandocUListItem display', 'conceal cchar=…')
endif
" }}}3

Expand Down
34 changes: 33 additions & 1 deletion tests/smart.pdc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# smart punctuation
# Smart Punctuation

# Ellipses ...

Expand All @@ -15,6 +15,38 @@ 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
Expand Down

0 comments on commit ee59c57

Please sign in to comment.