From e02883baf2fd2a0cfc21bd557bc0ecc69afd707c Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Mon, 10 Aug 2015 16:51:59 -0700 Subject: Cosmetic refactoring of post_body.jsx --- web/static/js/marked/lib/marked.js | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) (limited to 'web/static/js/marked') diff --git a/web/static/js/marked/lib/marked.js b/web/static/js/marked/lib/marked.js index 5c7d89f46..4085649a5 100644 --- a/web/static/js/marked/lib/marked.js +++ b/web/static/js/marked/lib/marked.js @@ -194,18 +194,6 @@ Lexer.prototype.token = function(src, top, bq) { continue; } - // top-level paragraph - if (top && (cap = this.rules.paragraph.exec(src))) { - src = src.substring(cap[0].length); - this.tokens.push({ - type: 'paragraph', - text: cap[1].charAt(cap[1].length - 1) === '\n' - ? cap[1].slice(0, -1) - : cap[1] - }); - continue; - } - // text if (cap = this.rules.text.exec(src)) { // Top-level should never reach here. @@ -240,7 +228,7 @@ var inline = { nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/, strong: /^\*((?:\*\*|[\s\S])+?)\*/, em: /^\b_((?:[^_]|__)+?)_\b/, - code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/, + code: /^(`{1})\s*([^\r?\n|\r]*?[^`])\s*\1(?!`)/, br: /^ {2,}\n(?!\s*$)/, del: noop, text: /^[\s\S]+?(?=[\\' + code + ''; - /*if (this.options.highlight) { - var out = this.options.highlight(code, lang); - if (out != null && out !== code) { - escaped = true; - code = out; - } - } - if (!lang) { return '
'
       + (escaped ? code : escape(code, true))
@@ -504,7 +476,7 @@ Renderer.prototype.code = function(code, lang, escaped) {
     + escape(lang, true)
     + '">'
     + (escaped ? code : escape(code, true))
-    + '\n
\n';*/ + + '\n\n'; }; Renderer.prototype.blockquote = function(quote) { -- cgit v1.2.3-1-g7c22