diff options
author | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-08-10 16:51:59 -0700 |
---|---|---|
committer | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-08-12 11:19:42 -0700 |
commit | e02883baf2fd2a0cfc21bd557bc0ecc69afd707c (patch) | |
tree | c874014e674764172e6caf73a34886ce7a020db4 /web/static/js/marked/lib | |
parent | 23a331f933af834ed1a26806f087e61ca6ddd93a (diff) | |
download | chat-e02883baf2fd2a0cfc21bd557bc0ecc69afd707c.tar.gz chat-e02883baf2fd2a0cfc21bd557bc0ecc69afd707c.tar.bz2 chat-e02883baf2fd2a0cfc21bd557bc0ecc69afd707c.zip |
Cosmetic refactoring of post_body.jsx
Diffstat (limited to 'web/static/js/marked/lib')
-rw-r--r-- | web/static/js/marked/lib/marked.js | 32 |
1 files changed, 2 insertions, 30 deletions
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]+?(?=[\\<!\[_*`]| {2,}\n|$)/ @@ -394,13 +382,6 @@ InlineLexer.prototype.output = function(src) { continue; } - // br - if (cap = this.rules.br.exec(src)) { - src = src.substring(cap[0].length); - out += this.renderer.br(); - continue; - } - // text if (cap = this.rules.text.exec(src)) { src = src.substring(cap[0].length); @@ -484,15 +465,6 @@ function Renderer(options) { } Renderer.prototype.code = function(code, lang, escaped) { - return '<pre>' + code + '</pre>'; - /*if (this.options.highlight) { - var out = this.options.highlight(code, lang); - if (out != null && out !== code) { - escaped = true; - code = out; - } - } - if (!lang) { return '<pre><code>' + (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</code></pre>\n';*/ + + '\n</code></pre>\n'; }; Renderer.prototype.blockquote = function(quote) { |