Closed JoeColmado closed 1 year ago
Interesting :D Likely something that the browser does and we don't have any direct control over.
Can you provide a workaround?
No, this would be way outside our documented goals and threat model: https://github.com/cure53/DOMPurify/wiki/Security-Goals-&-Threat-Model
You can probably fix that with a hook, if it's of high impact to you specific use-case.
While using your plugin, I noticed a discrepancy between different browsers. I was able to replicate different behavior between Chrome and Firefox (Version: 114.0). When an HTML tag has the attribute type="hidden", Firefox removes line breaks. Chrome doesn't Console Snippet to reproduce:
foo= '<input value="foo\nbar">' window.DOMPurify.sanitize(foo) foo= '<input value="foo\nbar" type="hidden">' window.DOMPurify.sanitize(foo) ;
Is this a bug or is there a configuration to trigger the same behavior between the browser?