summaryrefslogtreecommitdiffhomepage
path: root/libs/web
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2008-07-07 21:31:56 +0000
committerJo-Philipp Wich <jow@openwrt.org>2008-07-07 21:31:56 +0000
commit2fda23522360e4a800012b052bb7426dda4a9fe1 (patch)
tree32710ff2f61039e04c2851ff0a15c90fed6aba7b /libs/web
parente8e67f15cde3583d81cffd8801e7d3f6678ff3c1 (diff)
* luci/libs/web: fixed whitespace strip condition in template parser
Diffstat (limited to 'libs/web')
-rw-r--r--libs/web/luasrc/template.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/web/luasrc/template.lua b/libs/web/luasrc/template.lua
index bc216e1b5..5647865f7 100644
--- a/libs/web/luasrc/template.lua
+++ b/libs/web/luasrc/template.lua
@@ -55,9 +55,9 @@ function compile(template)
-- Search all <% %> expressions (remember: Lua table indexes begin with #1)
local function expr_add(ws1, skip1, command, skip2, ws2)
table.insert(expr, command)
- return ( skip1 and "" or ws1 ) ..
+ return ( #skip1 > 0 and "" or ws1 ) ..
"<%" .. tostring(#expr) .. "%>" ..
- ( skip2 and "" or ws2 )
+ ( #skip2 > 0 and "" or ws2 )
end
-- As "expr" should be local, we have to assign it to the "expr_add" scope