|
@ -84,6 +84,24 @@ MarkdownIt.prototype.configure = function (presets) { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Sugar to enable rules by names in all chains at once
|
|
|
|
|
|
//
|
|
|
|
|
|
MarkdownIt.prototype.enable = function (list) { |
|
|
|
|
|
[ 'core', 'block', 'inline' ].forEach(function (chain) { |
|
|
|
|
|
this[chain].ruler.enable(list, true); |
|
|
|
|
|
}, this); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Sugar to disable rules by names in all chains at once
|
|
|
|
|
|
//
|
|
|
|
|
|
MarkdownIt.prototype.disable = function (list) { |
|
|
|
|
|
[ 'core', 'block', 'inline' ].forEach(function (chain) { |
|
|
|
|
|
this[chain].ruler.disable(list, true); |
|
|
|
|
|
}, this); |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Sugar for curried plugins init:
|
|
|
// Sugar for curried plugins init:
|
|
|
//
|
|
|
//
|
|
|
// var md = new MarkdownIt();
|
|
|
// var md = new MarkdownIt();
|
|
@ -109,6 +127,7 @@ MarkdownIt.prototype.parse = function (src, env) { |
|
|
return state.tokens; |
|
|
return state.tokens; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Main method that does all magic :)
|
|
|
// Main method that does all magic :)
|
|
|
//
|
|
|
//
|
|
|
MarkdownIt.prototype.render = function (src, env) { |
|
|
MarkdownIt.prototype.render = function (src, env) { |
|
@ -129,6 +148,7 @@ MarkdownIt.prototype.parseInline = function (src, env) { |
|
|
return state.tokens; |
|
|
return state.tokens; |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Render single string, without wrapping it to paragraphs
|
|
|
// Render single string, without wrapping it to paragraphs
|
|
|
//
|
|
|
//
|
|
|
MarkdownIt.prototype.renderInline = function (src, env) { |
|
|
MarkdownIt.prototype.renderInline = function (src, env) { |
|
|