mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-21 02:29:23 +00:00
refactor(util) render, ownRedner
This commit is contained in:
parent
3013386eef
commit
47bf6677dd
1 changed files with 6 additions and 5 deletions
11
lib/util.js
11
lib/util.js
|
|
@ -570,10 +570,11 @@
|
|||
*/
|
||||
this.render = function(templ, view) {
|
||||
var ret,
|
||||
SPACES = '\\s*',
|
||||
symbols = ['{{' + SPACES, SPACES + '}}'];
|
||||
NOT_ESCAPE = true,
|
||||
SPACES = '\\s*',
|
||||
symbols = ['{{' + SPACES, SPACES + '}}'];
|
||||
|
||||
ret = Util.ownRender(templ, view, symbols);
|
||||
ret = Util.ownRender(templ, view, symbols, NOT_ESCAPE);
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
|
@ -584,7 +585,7 @@
|
|||
* @view
|
||||
* @symbols
|
||||
*/
|
||||
this.ownRender = function(templ, view, symbols) {
|
||||
this.ownRender = function(templ, view, symbols, notEscape) {
|
||||
var str, param, expr,
|
||||
ret = templ,
|
||||
firstChar,
|
||||
|
|
@ -597,7 +598,7 @@
|
|||
str = view[param];
|
||||
str = Util.exec(str) || str;
|
||||
expr = firstChar + param + secondChar;
|
||||
ret = Util.replaceStr(ret, expr, str, true);
|
||||
ret = Util.replaceStr(ret, expr, str, notEscape);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue