projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e8e67f1
)
* luci/libs/web: fixed whitespace strip condition in template parser
author
Jo-Philipp Wich
<jow@openwrt.org>
Mon, 7 Jul 2008 21:31:56 +0000
(21:31 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Mon, 7 Jul 2008 21:31:56 +0000
(21:31 +0000)
libs/web/luasrc/template.lua
patch
|
blob
|
history
diff --git
a/libs/web/luasrc/template.lua
b/libs/web/luasrc/template.lua
index bc216e1b50de9da3436c95f8d84c57e83c754bde..5647865f7a298bb411a07ebc1a868aa516639855 100644
(file)
--- 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