From 81133166502e360a105ffe305b5d0bc45fc59e9c 2012-05-23 02:13:35 From: Roy Hyunjin Han Date: 2012-05-23 02:13:35 Subject: [PATCH] Added target="_blank" to hyperlinks in Markdown.Converter.js so that clicking on a link opens it in a new window. Fixes Issue #1701 and adds surrounding quotes. --- diff --git a/IPython/frontend/html/notebook/static/pagedown/Markdown.Converter.js b/IPython/frontend/html/notebook/static/pagedown/Markdown.Converter.js index 9a1a4f7..8f44202 100644 --- a/IPython/frontend/html/notebook/static/pagedown/Markdown.Converter.js +++ b/IPython/frontend/html/notebook/static/pagedown/Markdown.Converter.js @@ -590,7 +590,7 @@ else result += " title=\"" + title + "\""; } - result += ">" + link_text + ""; + result += " target=\"_blank\">" + link_text + ""; return result; } @@ -1183,7 +1183,8 @@ else function _DoAutoLinks(text) { - // note that at this point, all other URL in the text are already hyperlinked as + // note that at this point, all other URL in the text are already + // hyperlinked as // *except* for the case // automatically add < and > around unadorned raw hyperlinks @@ -1192,7 +1193,7 @@ else // autolink anything like - var replacer = function (wholematch, m1) { return "" + pluginHooks.plainLinkText(m1) + ""; } + var replacer = function (wholematch, m1) { return "" + pluginHooks.plainLinkText(m1) + ""; } text = text.replace(/<((https?|ftp):[^'">\s]+)>/gi, replacer); // Email addresses: