Open d9k opened 6 years ago
Lua page are different from PHP. See this: https://keplerproject.github.io/cgilua/manual.html#templates If this knowledge let you do what you need then ok. Or try with this module: https://github.com/TiagoDanin/htmlEntities-for-lua/blob/master/README.md
@CodelessFuture, thanks a lot, but htmlEntities.encode(s)
doesn't encode double quote "
into "
as expected!
Created and issue at htmlEntities project too: https://github.com/TiagoDanin/htmlEntities-for-lua/issues/6
maintainer of htmlEntities-for-lua fixed an issue, thanks him a lot!
@CodelessFuture, now the question is would sailor framework include dependency to htmlEntities?
And html_encode
function must be available at the templates by default, I think...
Hi. I'm having some trouble at work in this period. I think I can dedicate my time at Sailor again for the end of this month.
I asked this question at sailor chat but no one answered.
How to html encode in sailor? For example if you want to output string variable which contains double quotes character into html tag argument value?
Example usage:
<input value="<?= htmlspecialchars(myvariable) ?> " >
(function must be available at templates (.lp) files)See php documentation for similar function: http://php.net/manual/en/function.htmlspecialchars.php