In the spirit of keeping the public API of mustache.js as small as possible for maintainence reasons, the undocumented and un-tested `.to_html()` method is removed. The functionality involved, where it can rather invoke an optional function provided with the result of `.render()`, instead of returning it as a string like `.render()` does, is something that using projects very easily can do themselfs -- it does not have to be provided by mustache.js.pull/735/head
| @@ -672,7 +672,6 @@ | |||||
| escape: undefined, | escape: undefined, | ||||
| parse: undefined, | parse: undefined, | ||||
| render: undefined, | render: undefined, | ||||
| to_html: undefined, | |||||
| Scanner: undefined, | Scanner: undefined, | ||||
| Context: undefined, | Context: undefined, | ||||
| Writer: undefined, | Writer: undefined, | ||||
| @@ -727,20 +726,6 @@ | |||||
| return defaultWriter.render(template, view, partials, tags); | return defaultWriter.render(template, view, partials, tags); | ||||
| }; | }; | ||||
| // This is here for backwards compatibility with 0.4.x., | |||||
| /*eslint-disable */ // eslint wants camel cased function name | |||||
| mustache.to_html = function to_html (template, view, partials, send) { | |||||
| /*eslint-enable*/ | |||||
| var result = mustache.render(template, view, partials); | |||||
| if (isFunction(send)) { | |||||
| send(result); | |||||
| } else { | |||||
| return result; | |||||
| } | |||||
| }; | |||||
| // Export the escaping function so that the user may override it. | // Export the escaping function so that the user may override it. | ||||
| // See https://github.com/janl/mustache.js/issues/244 | // See https://github.com/janl/mustache.js/issues/244 | ||||
| mustache.escape = escapeHtml; | mustache.escape = escapeHtml; | ||||
| @@ -665,7 +665,6 @@ var mustache = { | |||||
| escape: undefined, | escape: undefined, | ||||
| parse: undefined, | parse: undefined, | ||||
| render: undefined, | render: undefined, | ||||
| to_html: undefined, | |||||
| Scanner: undefined, | Scanner: undefined, | ||||
| Context: undefined, | Context: undefined, | ||||
| Writer: undefined, | Writer: undefined, | ||||
| @@ -720,20 +719,6 @@ mustache.render = function render (template, view, partials, tags) { | |||||
| return defaultWriter.render(template, view, partials, tags); | return defaultWriter.render(template, view, partials, tags); | ||||
| }; | }; | ||||
| // This is here for backwards compatibility with 0.4.x., | |||||
| /*eslint-disable */ // eslint wants camel cased function name | |||||
| mustache.to_html = function to_html (template, view, partials, send) { | |||||
| /*eslint-enable*/ | |||||
| var result = mustache.render(template, view, partials); | |||||
| if (isFunction(send)) { | |||||
| send(result); | |||||
| } else { | |||||
| return result; | |||||
| } | |||||
| }; | |||||
| // Export the escaping function so that the user may override it. | // Export the escaping function so that the user may override it. | ||||
| // See https://github.com/janl/mustache.js/issues/244 | // See https://github.com/janl/mustache.js/issues/244 | ||||
| mustache.escape = escapeHtml; | mustache.escape = escapeHtml; | ||||