Different output at node and at browser
Opened this issue · 3 comments
istarkov commented
simple example
const insane = require('insane');
console.log(insane('<a href="j">test</a>'));
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/k3ql74k5y5
This causes an issues with server side rendering.
istarkov commented
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?
istarkov commented
I just checked and in both cases sanitize-html
uses decode/encode
so both output of above is <a href="j">test</a>