Skip to content

Commit ee59c57

Browse files
rwxrobalerque
authored andcommitted
Fix ellipsis, start fix for en and em-dash
1 parent efe6a9a commit ee59c57

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

syntax/pandoc.vim

+3-3
Original file line numberDiff line numberDiff line change
@@ -501,19 +501,19 @@ endif
501501

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

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

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

tests/smart.pdc

+33-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# smart punctuation
1+
# Smart Punctuation
22

33
# Ellipses ...
44

@@ -15,6 +15,38 @@ Blah ... blah.
1515
... and yet.
1616
...and yet.
1717

18+
* I'm in a bullet...
19+
20+
Endash --
21+
----------
22+
23+
Endash --
24+
==========
25+
26+
And then there was --
27+
28+
Blah--blah.
29+
Blah -- blah.
30+
31+
-- and yet.
32+
--and yet.
33+
34+
* I'm in a bullet...
35+
36+
Emdash ---
37+
---------
38+
39+
Emdash ---
40+
==========
41+
42+
And then there was ---
43+
44+
Blah---blah.
45+
Blah --- blah.
46+
47+
--- and yet.
48+
---and yet.
49+
1850
# "Foo" is a thing
1951

2052
A "Foo" is a thing

0 commit comments

Comments
 (0)