diff options
-rw-r--r-- | lib/markdown-inline.js | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/markdown-inline.js b/lib/markdown-inline.js index 238d0f1..56693e5 100644 --- a/lib/markdown-inline.js +++ b/lib/markdown-inline.js @@ -9,7 +9,7 @@ var inlineRenderer = new marked.Renderer() inlineRenderer.urltransform = function (url) { return false } inlineRenderer.link = function (href, title, text) { return unquote(shortenIfLink(text)) } inlineRenderer.image = function (href, title, text) { return unquote(shortenIfLink(text)) } -inlineRenderer.code = function(code, lang, escaped) { return escaped ? code : escape(code) } +inlineRenderer.code = function(code, lang, escaped) { return escaped ? unquote(code) : code } inlineRenderer.blockquote = function(quote) { return unquote(quote) } inlineRenderer.html = function(html) { return false } inlineRenderer.heading = function(text, level, raw) { return unquote(text)+' ' } @@ -30,15 +30,8 @@ inlineRenderer.hashtag = function(preceding, tag) { return unquote((preceding||' function unquote (text) { return text.replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, '\'') -} - -function escape (text) { - return text - .replace(/&/g, '&') - .replace(/</g, '<') - .replace(/>/g, '>') - .replace(/"/g, '"') - .replace(/\n+/g, ' ') + .replace(/>/g, '>') + .replace(/</g, '<') } function shortenIfLink (text) { |