Skip to content

Commit

Permalink
fix(strikethrough): allow escapinging tilde char
Browse files Browse the repository at this point in the history
Since tilde is now used as a magic markdown character,
in strikethrough syntax, we need to enable escaping it.

Closes #331
  • Loading branch information
tivie committed Jan 28, 2017
1 parent a4c24c9 commit 24d47d7
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion 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.

2 changes: 1 addition & 1 deletion 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/encodeBackslashEscapes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
showdown.subParser('encodeBackslashEscapes', function (text) {
'use strict';
text = text.replace(/\\(\\)/g, showdown.helper.escapeCharactersCallback);
text = text.replace(/\\([`*_{}\[\]()>#+-.!])/g, showdown.helper.escapeCharactersCallback);
text = text.replace(/\\([`*_{}\[\]()>#+-.!~])/g, showdown.helper.escapeCharactersCallback);
return text;
});
1 change: 1 addition & 0 deletions test/features/#331.allow-escaping-of-tilde.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>~~test~~</p>
1 change: 1 addition & 0 deletions test/features/#331.allow-escaping-of-tilde.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\~~test~~
2 changes: 2 additions & 0 deletions test/node/testsuite.features.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ describe('makeHtml() features testsuite', function () {
converter = new showdown.Converter({encodeEmails: false});
} else if (testsuite[i].name === '#330.simplifiedAutoLink-drops-character-before-and-after-linked-mail') {
converter = new showdown.Converter({encodeEmails: false, simplifiedAutoLink: true});
} else if (testsuite[i].name === '#331.allow-escaping-of-tilde') {
converter = new showdown.Converter({strikethrough: true});
} else {
converter = new showdown.Converter();
}
Expand Down

0 comments on commit 24d47d7

Please sign in to comment.