Open scr-oath opened 1 year ago
Something like this seems to work and would be nice to add to std.
function(s)
local chars = std.stringChars(s);
local escapes = {
'<': '<',
'>': '>',
'&': '&',
'"': '"',
"'": ''',
};
local escapedChars = std.map(function(c) std.get(escapes, c, c), chars);
std.join('', escapedChars)
How does one properly escape user inputs / data for insertion into contents of a tag?
(Yes the statement is false 😄 , as is the output - it should be
5 < 4
)