|
|
@ -18,19 +18,6 @@ var config = { |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
function StateCore(self, src, env) { |
|
|
|
this.src = src; |
|
|
|
this.env = env; |
|
|
|
this.options = self.options; |
|
|
|
this.tokens = []; |
|
|
|
this.inlineMode = false; |
|
|
|
|
|
|
|
this.inline = self.inline; |
|
|
|
this.block = self.block; |
|
|
|
this.renderer = self.renderer; |
|
|
|
this.typographer = self.typographer; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* class MarkdownIt |
|
|
|
* |
|
|
@ -215,7 +202,7 @@ function MarkdownIt(presetName, options) { |
|
|
|
* Assorted utility functions, useful to write plugins. See details |
|
|
|
* [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.js).
|
|
|
|
**/ |
|
|
|
this.utils = utils; |
|
|
|
this.utils = utils; |
|
|
|
|
|
|
|
/** |
|
|
|
* MarkdownIt#helpers -> helpers |
|
|
@ -223,10 +210,10 @@ function MarkdownIt(presetName, options) { |
|
|
|
* Link components parser functions, useful to write plugins. See details |
|
|
|
* [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers).
|
|
|
|
**/ |
|
|
|
this.helpers = helpers; |
|
|
|
this.helpers = helpers; |
|
|
|
|
|
|
|
|
|
|
|
this.options = {}; |
|
|
|
this.options = {}; |
|
|
|
this.configure(config[presetName]); |
|
|
|
|
|
|
|
if (options) { this.set(options); } |
|
|
@ -359,7 +346,7 @@ MarkdownIt.prototype.use = function (plugin /*, params, ... */) { |
|
|
|
* You will not need it with high probability. |
|
|
|
**/ |
|
|
|
MarkdownIt.prototype.parse = function (src, env) { |
|
|
|
var state = new StateCore(this, src, env); |
|
|
|
var state = new this.core.State(src, this, env); |
|
|
|
|
|
|
|
this.core.process(state); |
|
|
|
|
|
|
@ -395,7 +382,7 @@ MarkdownIt.prototype.render = function (src, env) { |
|
|
|
* tokens in `children` property. |
|
|
|
**/ |
|
|
|
MarkdownIt.prototype.parseInline = function (src, env) { |
|
|
|
var state = new StateCore(this, src, env); |
|
|
|
var state = new this.core.State(src, this, env); |
|
|
|
|
|
|
|
state.inlineMode = true; |
|
|
|
this.core.process(state); |
|
|
|