X Tutup
Skip to content

Commit f574ea9

Browse files
committed
update entity lengths
1 parent 6cfcd5c commit f574ea9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

web_sanitize/patterns.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ translate_entity = function(str, kind, value)
9797
return str
9898
end
9999
end
100-
local annoteted_html_entity = C(P("&") * (Cc("named") * at_most(alphanum, 20) + P("#") * (Cc("dec") * C(at_most(num, 10)) + S("xX") * Cc("hex") * C(at_most(hex, 5)))) * P(";") ^ -1)
100+
local annoteted_html_entity = C(P("&") * (Cc("named") * at_most(alphanum, 31) + P("#") * (Cc("dec") * C(at_most(num, 10)) + S("xX") * Cc("hex") * C(at_most(hex, 6)))) * P(";") ^ -1)
101101
local decode_html_entity = annoteted_html_entity / translate_entity
102102
local unescape_html_text = Cs((decode_html_entity + P(1)) ^ 0)
103103
return {

web_sanitize/patterns.moon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ translate_entity = (str, kind, value) ->
121121
else
122122
str
123123

124-
annoteted_html_entity = C P"&" * (Cc"named" * at_most(alphanum, 20) + P"#" * (Cc"dec" * C(at_most(num, 10)) + S"xX" * Cc"hex" * C(at_most(hex, 5)))) * P";"^-1
124+
annoteted_html_entity = C P"&" * (Cc"named" * at_most(alphanum, 31) + P"#" * (Cc"dec" * C(at_most(num, 10)) + S"xX" * Cc"hex" * C(at_most(hex, 6)))) * P";"^-1
125125
decode_html_entity = annoteted_html_entity / translate_entity
126126

127127
-- unescapes an html text string that may contain html entities

0 commit comments

Comments
 (0)
X Tutup