fix(naughty: widget: _markup): correctly un-escape "<span property=value>"

This commit is contained in:
actionless 2020-04-23 13:44:34 +02:00
parent 87928befe2
commit 124c6f9b23
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ local escape_pattern = "[<>&]"
local escape_subs = { ['<'] = "&lt;", ['>'] = "&gt;", ['&'] = "&amp;" } local escape_subs = { ['<'] = "&lt;", ['>'] = "&gt;", ['&'] = "&amp;" }
-- Also reverse escaping some allowed tags because people actually use them. -- Also reverse escaping some allowed tags because people actually use them.
local escape_undo = {['&lt;span '] = "<span "} local escape_undo = {["&lt;(span[^&]+)&gt;"] = "<%1>"}
for _, allowed in ipairs {'b', 'i', 'u', 'span'} do for _, allowed in ipairs {'b', 'i', 'u', 'span'} do
escape_undo['&lt;' ..allowed..'&gt;'] = "<" ..allowed..">" escape_undo['&lt;' ..allowed..'&gt;'] = "<" ..allowed..">"