Skip to content

Commit

Permalink
fix(strikethrough): Fix strikethrough issue with escaped chars
Browse files Browse the repository at this point in the history
Closes #214
  • Loading branch information
tivie committed Oct 30, 2015
1 parent f81789f commit 5669317
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions dist/showdown.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/showdown.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/showdown.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/showdown.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/subParsers/strikethrough.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Your friend ~~[**test\***](www.google.com)~~ (~~[*@test*](www.google.com)~~) updated his/her description
2 changes: 1 addition & 1 deletion test/node/testsuite.features.js
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand Down

0 comments on commit 5669317

Please sign in to comment.