|
@ -68,11 +68,11 @@ Remarkable.prototype.use = function (plugin, opts) { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Main method that does all magic :)
|
|
|
// Parse input string, returns tokens array. Modify `env` with
|
|
|
|
|
|
// definitions data.
|
|
|
//
|
|
|
//
|
|
|
Remarkable.prototype.render = function (src) { |
|
|
Remarkable.prototype.parse = function (src, env) { |
|
|
var tokens, tok, i, l, env = { references: Object.create(null) }; |
|
|
var tokens, tok, i, l; |
|
|
|
|
|
|
|
|
// Parse blocks
|
|
|
// Parse blocks
|
|
|
tokens = this.block.parse(src, this.options, env); |
|
|
tokens = this.block.parse(src, this.options, env); |
|
|
|
|
|
|
|
@ -84,8 +84,15 @@ Remarkable.prototype.render = function (src) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Render
|
|
|
return tokens; |
|
|
return this.renderer.render(tokens, this.options, env); |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// Main method that does all magic :)
|
|
|
|
|
|
//
|
|
|
|
|
|
Remarkable.prototype.render = function (src) { |
|
|
|
|
|
var env = { references: {} }; |
|
|
|
|
|
|
|
|
|
|
|
return this.renderer.render(this.parse(src, env), this.options, env); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|