-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ellipsis): add auto-ellipsis support
Three dots `...` are now converted automatically into an ellipsis
- Loading branch information
Showing
10 changed files
with
71 additions
and
5 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
showdown.subParser('ellipsis', function (text, options, globals) { | ||
'use strict'; | ||
|
||
text = globals.converter._dispatch('ellipsis.before', text, options, globals); | ||
|
||
text = text.replace(/\.\.\./g, '…'); | ||
|
||
text = globals.converter._dispatch('ellipsis.after', text, options, globals); | ||
|
||
return text; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<p>ellipsis in text…</p> | ||
<p>…</p> | ||
<ol> | ||
<li>foo…</li> | ||
<li>bar</li> | ||
</ol> | ||
<blockquote> | ||
<p>ellipsis in blockquote…</p> | ||
</blockquote> | ||
<pre><code>ellipsis in code... | ||
</code></pre> | ||
<pre><code>ellipsis in code... | ||
</code></pre> | ||
<h1 id="ellipsisinheader">ellipsis in header…</h1> | ||
<p>1…</p> | ||
<ol> | ||
<li>..</li> | ||
</ol> | ||
<p>1…</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
ellipsis in text... | ||
|
||
... | ||
|
||
1. foo... | ||
2. bar | ||
|
||
> ellipsis in blockquote... | ||
``` | ||
ellipsis in code... | ||
``` | ||
|
||
ellipsis in code... | ||
|
||
# ellipsis in header... | ||
|
||
1... | ||
|
||
1. .. | ||
|
||
1... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
* foo | ||
* bar | ||
|
||
... | ||
--- | ||
|
||
* baz | ||
1. bazinga |