Open istarkov opened 6 years ago
The issue is that for browser used escape/unescapeHtml
from ./she.js
but he.decode/encode
at node
@bevacqua what the reason to use 2 different method of conversion depending on env?
I just checked and in both cases sanitize-html
uses decode/encode
so both output of above is <a href="j">test</a>
I think you did that to reduce dependency size at browser level? If yes it's possibly better to use she.js
in both environments, otherwise it's hard to use the library with server side rendering libs like React. See #10
simple example
Running this under node gives
<a href="j">test</a>
see https://repl.it/repls/CloseMassiveArchitects And running this under browser gives<a href="&#106;">test</a>
see https://codesandbox.io/s/k3ql74k5y5This causes an issues with server side rendering.