henix / slt2

a simple Lua template processor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support nil values

henix opened this issue · comments

test code:

runslt2.lua -v "{name=nil}" <<EOF
<p>#{= name }#</p>
EOF

result:

<p>

expect result:

<p></p>

If a value is nil, the coroutine function will return nil, the same as it is terminated. So we must distinguish the 2 situations.