* luci/libs/web: fixed whitespace strip condition in template parser
This commit is contained in:
parent
e8e67f15cd
commit
2fda235223
1 changed files with 2 additions and 2 deletions
|
@ -55,9 +55,9 @@ function compile(template)
|
||||||
-- Search all <% %> expressions (remember: Lua table indexes begin with #1)
|
-- Search all <% %> expressions (remember: Lua table indexes begin with #1)
|
||||||
local function expr_add(ws1, skip1, command, skip2, ws2)
|
local function expr_add(ws1, skip1, command, skip2, ws2)
|
||||||
table.insert(expr, command)
|
table.insert(expr, command)
|
||||||
return ( skip1 and "" or ws1 ) ..
|
return ( #skip1 > 0 and "" or ws1 ) ..
|
||||||
"<%" .. tostring(#expr) .. "%>" ..
|
"<%" .. tostring(#expr) .. "%>" ..
|
||||||
( skip2 and "" or ws2 )
|
( #skip2 > 0 and "" or ws2 )
|
||||||
end
|
end
|
||||||
|
|
||||||
-- As "expr" should be local, we have to assign it to the "expr_add" scope
|
-- As "expr" should be local, we have to assign it to the "expr_add" scope
|
||||||
|
|
Loading…
Reference in a new issue