Sanitizer to allow base64 images? #280
Unanswered
andreisctendava
asked this question in
Q&A
Replies: 1 comment
-
See https://github.com/mganss/HtmlSanitizer/wiki/Examples#ex2-allowing-data-uris for an example of how to allow data URIs. I'd assume you could extend than relatively easily. There's also the FilterUrl event. You'd likely need to implement a custom event handler for that, assuming your content can have HTTP/HTTPS URLs for other elements, like anchor tags. If not, you could clear the AllowedSchemes collection and then add "data". |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have a question.
How I can configure the Sanitizer to allow base64 images
<img src=\"data:image/png;base64, iVBORw0KGgo...">
and disallow images like this
<img src="url_to_image">
?Thanks.
Beta Was this translation helpful? Give feedback.
All reactions