Closed mirabilos closed 8 years ago
Test (in Firebug’s Konsole):
> he.encode("foo \x22 bar",{strict:true})
"foo &x22; bar"
> he.encode("foo \x02 bar",{strict:true})
Error: Parse error: forbidden code point
> he.encode("foo \x00 bar",{strict:true})
Error: Parse error: forbidden code point
So, adding the 'strict' option makes the he.encode()
function usable as a general encoding library.
No coverage report found for master at d2c219f.
Powered by Codecov. Last update d2c219f...82ba170
I’ve decided to phrase it differently, but consider this merged! Thanks.
make it clear that the 'strict' option removes the input being valid constraint
(without 'strict', the output is only valid if the input is valid; some people require an encoder that takes any input, valid or not, and encodes it into valid output (or throws an exception if it cannot be encoded), i.e. does not silently pass invalid input into invalid output)