whitespace normalization

This commit is contained in:
Christopher Jeffrey 2011-10-04 17:40:33 -05:00
parent 70da22d078
commit a8aab0a6c9

View File

@ -41,12 +41,9 @@ block.lexer = function(str) {
var tokens = [] var tokens = []
, links = {}; , links = {};
// normalize whitespace str = str.replace(/\r\n|\r/g, '\n')
str = str.replace(/\r\n/g, '\n')
.replace(/\r/g, '\n')
.replace(/\t/g, ' '); .replace(/\t/g, ' ');
// grab link definitons
str = str.replace( str = str.replace(
/^ {0,3}\[([^\]]+)\]: *([^ ]+)(?: +"([^\n]+)")? *$/gm, /^ {0,3}\[([^\]]+)\]: *([^ ]+)(?: +"([^\n]+)")? *$/gm,
function(__, id, href, title) { function(__, id, href, title) {