diff --git a/lib/marked.js b/lib/marked.js index 7c6af167..050205ab 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -11,7 +11,7 @@ var block = { newline: /^\n+/, - block: /^ {4,}[^\n]*(?:\n {4,}[^\n]*|\n)*(?=\n| *$)/, + code: /^ {4,}[^\n]*(?:\n {4,}[^\n]*|\n)*(?=\n| *$)/, hr: /^( *[\-*_]){3,} *\n/, heading: /^ *(#{1,6}) *([^\0]+?) *#* *\n+/, lheading: /^([^\n]+)\n *(=|-){3,}/, @@ -68,11 +68,11 @@ block.token = function(str, tokens) { continue; } - if (cap = block.block.exec(str)) { + if (cap = block.code.exec(str)) { str = str.substring(cap[0].length); cap = cap[0].replace(/^ {4}/gm, ''); tokens.push({ - type: 'block', + type: 'code', text: cap }); continue; @@ -256,7 +256,9 @@ inline.lexer = function(str) { text = escape(cap[1]); href = text; } - out += '' + out += '' + text + ''; continue; @@ -392,7 +394,7 @@ var tok = function() { + '>'; } - case 'block': { + case 'code': { return '
'
         + escape(token.text)
         + '
';