Skip to content

Commit f3012a2

Browse files
authored
Remove mustache.to_html() (#735)
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.
1 parent 5938104 commit f3012a2

File tree

3 files changed

+1
-31
lines changed

3 files changed

+1
-31
lines changed

mustache.js

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,6 @@
672672
escape: undefined,
673673
parse: undefined,
674674
render: undefined,
675-
to_html: undefined,
676675
Scanner: undefined,
677676
Context: undefined,
678677
Writer: undefined,
@@ -727,20 +726,6 @@
727726
return defaultWriter.render(template, view, partials, tags);
728727
};
729728

730-
// This is here for backwards compatibility with 0.4.x.,
731-
/*eslint-disable */ // eslint wants camel cased function name
732-
mustache.to_html = function to_html (template, view, partials, send) {
733-
/*eslint-enable*/
734-
735-
var result = mustache.render(template, view, partials);
736-
737-
if (isFunction(send)) {
738-
send(result);
739-
} else {
740-
return result;
741-
}
742-
};
743-
744729
// Export the escaping function so that the user may override it.
745730
// See https://github.com/janl/mustache.js/issues/244
746731
mustache.escape = escapeHtml;

0 commit comments

Comments
 (0)