瀏覽代碼

Remove mustache.to_html()

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
Phillip Johnsen 6 年之前
父節點
當前提交
9808a7075b
共有 3 個檔案被更改,包括 1 行新增31 行删除
  1. +0
    -15
      mustache.js
  2. +1
    -1
      mustache.min.js
  3. +0
    -15
      mustache.mjs

+ 0
- 15
mustache.js 查看文件

@@ -672,7 +672,6 @@
escape: undefined,
parse: undefined,
render: undefined,
to_html: undefined,
Scanner: undefined,
Context: undefined,
Writer: undefined,
@@ -727,20 +726,6 @@
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.
// See https://github.com/janl/mustache.js/issues/244
mustache.escape = escapeHtml;


+ 1
- 1
mustache.min.js
文件差異過大導致無法顯示
查看文件


+ 0
- 15
mustache.mjs 查看文件

@@ -665,7 +665,6 @@ var mustache = {
escape: undefined,
parse: undefined,
render: undefined,
to_html: undefined,
Scanner: undefined,
Context: undefined,
Writer: undefined,
@@ -720,20 +719,6 @@ mustache.render = function 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.
// See https://github.com/janl/mustache.js/issues/244
mustache.escape = escapeHtml;


Loading…
取消
儲存