mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
fix(strikethrough): Fix strikethrough issue with escaped chars
Closes #214
This commit is contained in:
parent
f81789f0fb
commit
5669317fe4
BIN
dist/showdown.js
vendored
BIN
dist/showdown.js
vendored
Binary file not shown.
BIN
dist/showdown.js.map
vendored
BIN
dist/showdown.js.map
vendored
Binary file not shown.
BIN
dist/showdown.min.js
vendored
BIN
dist/showdown.min.js
vendored
Binary file not shown.
BIN
dist/showdown.min.js.map
vendored
BIN
dist/showdown.min.js.map
vendored
Binary file not shown.
|
@ -3,7 +3,7 @@ showdown.subParser('strikethrough', function (text, options, globals) {
|
|||
|
||||
if (options.strikethrough) {
|
||||
text = globals.converter._dispatch('strikethrough.before', text, options);
|
||||
text = text.replace(/(?:~T){2}([^~]+)(?:~T){2}/g, '<del>$1</del>');
|
||||
text = text.replace(/(?:~T){2}([\s\S]+?)(?:~T){2}/g, '<del>$1</del>');
|
||||
text = globals.converter._dispatch('strikethrough.after', text, options);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
<p>Your friend <del><a href="www.google.com"><strong>test*</strong></a></del> (<del><a href="www.google.com"><em>@test</em></a></del>) updated his/her description</p>
|
|
@ -0,0 +1 @@
|
|||
Your friend ~~[**test\***](www.google.com)~~ (~~[*@test*](www.google.com)~~) updated his/her description
|
|
@ -19,7 +19,7 @@ describe('makeHtml() features testsuite', function () {
|
|||
converter = new showdown.Converter({simplifiedAutoLink: true});
|
||||
} else if (testsuite[i].name === '#164.2.disallow-underscore-emphasis-mid-word') {
|
||||
converter = new showdown.Converter({literalMidWordUnderscores: true});
|
||||
} else if (testsuite[i].name === '#164.3.strikethrough') {
|
||||
} else if (testsuite[i].name === '#164.3.strikethrough' || testsuite[i].name === '#214.escaped-markdown-chars-break-strikethrough') {
|
||||
converter = new showdown.Converter({strikethrough: true});
|
||||
} else if (testsuite[i].name === 'disable-gh-codeblocks') {
|
||||
converter = new showdown.Converter({ghCodeBlocks: false});
|
||||
|
|
Loading…
Reference in New Issue
Block a user