chore: cleanup code and comments

This commit is contained in:
Estevao Soares dos Santos 2017-01-29 19:50:21 +00:00
parent 169cbe8e2d
commit 062e465902
8 changed files with 4 additions and 18 deletions

BIN
dist/showdown.js vendored

Binary file not shown.

BIN
dist/showdown.js.map vendored

Binary file not shown.

BIN
dist/showdown.min.js vendored

Binary file not shown.

Binary file not shown.

View File

@ -28,19 +28,6 @@ showdown.subParser('codeSpans', function (text, options, globals) {
text = globals.converter._dispatch('codeSpans.before', text, options, globals);
/*
text = text.replace(/
(^|[^\\]) // Character before opening ` can't be a backslash
(`+) // $2 = Opening run of `
( // $3 = The code block
[^\r]*?
[^`] // attacklab: work around lack of lookbehind
)
\2 // Matching closer
(?!`)
/gm, function(){...});
*/
if (typeof(text) === 'undefined') {
text = '';
}

View File

@ -10,7 +10,7 @@ showdown.subParser('encodeAmpsAndAngles', function (text, options, globals) {
text = text.replace(/&(?!#?[xX]?(?:[0-9a-fA-F]+|\w+);)/g, '&');
// Encode naked <'s
text = text.replace(/<(?![a-z\/?\$!])/gi, '&lt;');
text = text.replace(/<(?![a-z\/?$!])/gi, '&lt;');
text = globals.converter._dispatch('encodeAmpsAndAngles.after', text, options, globals);
return text;

View File

@ -14,7 +14,7 @@ showdown.subParser('encodeBackslashEscapes', function (text, options, globals) {
text = globals.converter._dispatch('encodeBackslashEscapes.before', text, options, globals);
text = text.replace(/\\(\\)/g, showdown.helper.escapeCharactersCallback);
text = text.replace(/\\([`*_{}\[\]()>#+-.!~])/g, showdown.helper.escapeCharactersCallback);
text = text.replace(/\\([`*_{}\[\]()>#+.!~=-])/g, showdown.helper.escapeCharactersCallback);
text = globals.converter._dispatch('encodeBackslashEscapes.after', text, options, globals);
return text;

View File

@ -1,5 +1,5 @@
/**
* Within tags -- meaning between < and > -- encode [\ ` * _] so they
* Within tags -- meaning between < and > -- encode [\ ` * _ ~ =] so they
* don't conflict with their use in Markdown for code, italics and strong.
*/
showdown.subParser('escapeSpecialCharsWithinTagAttributes', function (text, options, globals) {
@ -13,8 +13,7 @@ showdown.subParser('escapeSpecialCharsWithinTagAttributes', function (text, opti
text = text.replace(regex, function (wholeMatch) {
return wholeMatch
.replace(/(.)<\/?code>(?=.)/g, '$1`')
//tag = showdown.helper.escapeCharacters(tag, '\\`*_', false);
.replace(/([\\`*_ ~=])/g, showdown.helper.escapeCharactersCallback);
.replace(/([\\`*_~=])/g, showdown.helper.escapeCharactersCallback);
});
text = globals.converter._dispatch('escapeSpecialCharsWithinTagAttributes.after', text, options, globals);