Merge pull request #3074 from actionless/fix-markup-escape

fix(naughty: widget: _markup): correctly un-escape "<span property=value>"
This commit is contained in:
Emmanuel Lepage Vallée 2020-05-04 01:50:12 -07:00 committed by GitHub
commit 38848bff04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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..">"