mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
fix(strikethrough): allow escapinging tilde char
Since tilde is now used as a magic markdown character, in strikethrough syntax, we need to enable escaping it. Closes #331
This commit is contained in:
parent
a4c24c9805
commit
24d47d7c68
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.
|
@ -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
test/features/#331.allow-escaping-of-tilde.html
Normal file
1
test/features/#331.allow-escaping-of-tilde.html
Normal file
|
@ -0,0 +1 @@
|
|||
<p>~~test~~</p>
|
1
test/features/#331.allow-escaping-of-tilde.md
Normal file
1
test/features/#331.allow-escaping-of-tilde.md
Normal file
|
@ -0,0 +1 @@
|
|||
\~~test~~
|
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user