From 52cd6161b4597f85436f521a01c2c14c08bf2d95 Mon Sep 17 00:00:00 2001 From: cel Date: Tue, 25 Apr 2017 16:51:26 -1000 Subject: Unescape more symbols --- lib/markdown-inline.js | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'lib/markdown-inline.js') 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(/\n+/g, ' ') + .replace(/>/g, '>') + .replace(/</g, '<') } function shortenIfLink (text) { -- cgit v1.2.3