Support for Strikethrough.

This commit is contained in:
joaocolombo 2012-04-09 11:13:48 -03:00
parent 3c52317851
commit 4640ffab62

View File

@ -389,7 +389,7 @@ var _RunSpanGamut = function(text) {
// delimiters in inline links like [this](<url>). // delimiters in inline links like [this](<url>).
text = _DoAutoLinks(text); text = _DoAutoLinks(text);
text = _EncodeAmpsAndAngles(text); text = _EncodeAmpsAndAngles(text);
text = _DoItalicsAndBold(text); text = _DoItalicsAndBoldAndStrikethrough(text);
// Do hard breaks: // Do hard breaks:
text = text.replace(/ +\n/g," <br />\n"); text = text.replace(/ +\n/g," <br />\n");
@ -978,19 +978,20 @@ var _EncodeCode = function(text) {
} }
var _DoItalicsAndBold = function(text) { var _DoItalicsAndBoldAndStrikethrough = function(text) {
// <strong> must go first: // <strong> must go first:
text = text.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g, text = text.replace(/(\*\*|__)(?=\S)([^\r]*?\S[*_]*)\1/g,
"<strong>$2</strong>"); "<strong>$2</strong>");
text = text.replace(/(~T~T)(?=\S)([^\r]*?\S[*_]*)\1/g, "<del>$2</del>");
text = text.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g, text = text.replace(/(\*|_)(?=\S)([^\r]*?\S)\1/g,
"<em>$2</em>"); "<em>$2</em>");
return text; return text;
} }
var _DoBlockQuotes = function(text) { var _DoBlockQuotes = function(text) {
/* /*