I'm using HTMLPurifier to make sure there is no malicious user input.
I'm having a hard time with base64 images. The regular one is already solved.
$config->set('URI.AllowedSchemes', ['data' => true]);
But how about the following?
<img src="data:image/svg+xml;base64,PHN2Zy...4MTEpIi8+PC9zdmc+Cg==" />
For everyone looking for a solution.. there is no built in way to allow base64 svg images. But there is a way to solve it.
I could not find an official documentation, but you can write custom validations.