Browse Source

added comments to new methods

pull/152/head
Jason McCarrell 10 years ago
parent
commit
86cc0ec083
  1. 9
      lib/index.js
  2. 10
      lib/renderer.js

9
lib/index.js

@ -513,6 +513,15 @@ MarkdownIt.prototype.render = function (src, env) {
return this.renderer.render(this.parse(src, env), this.options, env);
};
/**
* MarkdownIt.renderTokens(src [, env]) -> String
* - src (String): source string
* - env (Object): environment sandbox
*
* Render markdown string into an array of html-like tokens.
* If you want to render each token separately (for example with React)
**/
MarkdownIt.prototype.renderTokens = function (src, env) {
env = env || {};

10
lib/renderer.js

@ -294,6 +294,16 @@ Renderer.prototype.render = function (tokens, options, env) {
}, '');
};
/**
* Renderer.renderTokens(tokens, options, env) -> String
* - tokens (Array): list on block tokens to renter
* - options (Object): params of parser instance
* - env (Object): additional data from parsed input (references, for example)
*
* Takes token stream and generates html-like tokens. Probably, you will never need to call
* this method directly.
**/
Renderer.prototype.renderTokens = function (tokens, options, env) {
var i, len, type,
result = '',

Loading…
Cancel
Save