cleanup again

This commit is contained in:
Christopher Jeffrey 2011-08-21 13:47:23 -05:00
parent aab61affb3
commit b73907b6c8

View File

@ -25,10 +25,6 @@ var block = {
blockquote: /^ *>[^\n]*(?:\n *>[^\n]*)*/, blockquote: /^ *>[^\n]*(?:\n *>[^\n]*)*/,
// fastest with loose list support
// list: /^( *)(\*|\+|-|\d+\.)[^\n]*(?:\n[^\n]+|\n{2}\1\2[^\n]*)*/,
// fix ordered lists:
//list: /^( *)([*+-]|\d+\.) [^\n]*(?:\n[^\n]+|\n{2}\1(?:\2|\d+\.)[^\n]*)*/, //list: /^( *)([*+-]|\d+\.) [^\n]*(?:\n[^\n]+|\n{2}\1(?:\2|\d+\.)[^\n]*)*/,
// test // test
@ -38,7 +34,7 @@ var block = {
//html: /^<([^\/\s>]+)[^\n>]*>[^\n]*(?:\n[^\n]+)*\n?<\/\1>/, //html: /^<([^\/\s>]+)[^\n>]*>[^\n]*(?:\n[^\n]+)*\n?<\/\1>/,
// account for single tags // account for single tags
html: /^<[^>\n]+> *(?:\n{2}|$)|^<([^\/\s>]+)[^\n>]*>[^\n]*(?:\n[^\n]+)*\n?<\/\1>/, html: /^<[^>\n]+> *(?:\n{2}|\s*$)|^<([^\/\s>]+)[^\n>]*>[^\n]*(?:\n[^\n]+)*\n?<\/\1>/,
text: /^[^\n]+/ text: /^[^\n]+/
@ -291,15 +287,15 @@ inline.lexer = function(str) {
case 'link': case 'link':
case 'reflink': case 'reflink':
if (key === 'reflink') { if (key === 'reflink') {
link = links[cap[2]] || links[cap[1]]; link = cap[2]
? links[cap[2]]
: links[cap[1]];
if (!link) { if (!link) {
// apparently markdown says you're // apparently markdown says you're
// supposed to do this ...? // supposed to do this ...?
out += cap[0]; out += cap[0];
break; break;
} }
//if (!link) throw new
// Error('Undefined Reference: ' + cap[2]);
} else { } else {
text = /^\s*([^\s]*)(?:\s+"([^"]+)")?\s*$/.exec(cap[2]); text = /^\s*([^\s]*)(?:\s+"([^"]+)")?\s*$/.exec(cap[2]);
link = { link = {