diff --git a/lovebird.lua b/lovebird.lua index b0b715e..d586e77 100644 --- a/lovebird.lua +++ b/lovebird.lua @@ -497,8 +497,15 @@ function lovebird.parseurl(url) end +local htmlescapemap = { + ["<"] = "<", + ["&"] = "&", + ['"'] = """, + ["'"] = "'", +} + function lovebird.htmlescape(str) - return ( str:gsub("<", "<") ) + return ( str:gsub("[<&\"']", htmlescapemap) ) end