whitespace normalization
This commit is contained in:
parent
70da22d078
commit
a8aab0a6c9
@ -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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user