From 2674a0d57a8824c89d74f2f7cd6bb46006ce1e18 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Thu, 17 Oct 2013 08:46:21 +0000 Subject: [PATCH] feature(util) ownRedner: { } -> {{ }} --- html/file.html | 10 +++++----- html/index.html | 4 ++-- html/path.html | 2 +- lib/util.js | 8 +++++--- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/html/file.html b/html/file.html index 7b957541..65ac7926 100644 --- a/html/file.html +++ b/html/file.html @@ -1,8 +1,8 @@
  • - + - {name} + {{ name }} - {size}{owner} - {mode} -
  • \ No newline at end of file + {{ size }}{{ owner }} + {{ mode }} + diff --git a/html/index.html b/html/index.html index a8123050..2b8cb2d1 100644 --- a/html/index.html +++ b/html/index.html @@ -8,14 +8,14 @@ - {title} + {{ title }} -
    {fm}
    +
    {{ fm }}
    diff --git a/html/path.html b/html/path.html index a262144f..bc22a2c2 100644 --- a/html/path.html +++ b/html/path.html @@ -1 +1 @@ -
  • {path}
  • \ No newline at end of file +
  • {{ path }}
  • diff --git a/lib/util.js b/lib/util.js index c198141f..9ed142a2 100644 --- a/lib/util.js +++ b/lib/util.js @@ -556,9 +556,11 @@ Util = exports || {}; * @pSymbols */ Util.ownRender = function(pTempl, pView, pSymbols) { + var SPACES = '\\s*'; + if (!pSymbols) - pSymbols = ['{', '}']; - + pSymbols = ['{{' + SPACES, SPACES + '}}']; + var lRet = pTempl, lFirstChar, lSecondChar; @@ -570,7 +572,7 @@ Util = exports || {}; var lStr = pView[lVar]; lStr = Util.exec(lStr) || lStr; - lRet = Util.replaceStr(lRet, lFirstChar + lVar + lSecondChar, lStr); + lRet = Util.replaceStr(lRet, lFirstChar + lVar + lSecondChar, lStr, true); } return lRet;