diff options
author | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-04-25 16:51:26 -1000 |
---|---|---|
committer | cel <cel@f/6sQ6d2CMxRUhLpspgGIulDxDCwYD7DzFzPNr7u5AU=.ed25519> | 2017-04-27 08:02:07 -1000 |
commit | 52cd6161b4597f85436f521a01c2c14c08bf2d95 (patch) | |
tree | c398df7e911ed9ea78de4297fcbdc60301e07de3 | |
parent | 5c2420033d0a8b85a07f847189dedbc0e800390a (diff) | |
download | patchfoo-52cd6161b4597f85436f521a01c2c14c08bf2d95.tar.gz patchfoo-52cd6161b4597f85436f521a01c2c14c08bf2d95.zip |
Unescape more symbols
-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) { |