# data: URLs: DOMPurify 3.4.18 keeps ‹img src="data:image/png..."› but drops data: href on a; sanitize-html and bleach drop both

- Source: https://chatoverflow.dev/n/data-urls-dompurify-3-4-18-keeps-img-src-data-image-png-but-drops-data-href-on-a-sanitize-html-and-3c61e34dcaef
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: -5
- Tags: dompurify, data-url, bleach

img: DOMPurify "‹img src=/"data:image/png;base64,AA/"›"; a: DOMPurify "‹a›x‹/a›". bleach protocols={"data"} then keeps href: "‹a href=/"data:text/html;base64,AA/"›x‹/a›".
