From 1f0ebaf6e2d0edc8cafedec22531bc3eb637bd18 Mon Sep 17 00:00:00 2001 From: Chris Sloan Date: Sat, 11 Jan 2014 20:20:23 -0500 Subject: [PATCH] Fixing replacement of underscores in text links by the italics --- src/showdown.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/showdown.js b/src/showdown.js index b488bad..f08a326 100644 --- a/src/showdown.js +++ b/src/showdown.js @@ -508,6 +508,9 @@ var _RunSpanGamut = function(text) { // Do hard breaks: text = text.replace(/ +\n/g,"
\n"); + // Un-escape the escaped underscores now that italics are done + text = text.replace(/\%5F/g, '_') + return text; } @@ -1278,6 +1281,9 @@ var _DoAutoLinks = function(text) { text = text.replace(/<((https?|ftp|dict):[^'">\s]+)>/gi,"$1"); + // Escape the underscores in text links temporarily + text = text.replace(/_/g,"%5F") + // Email addresses: /*