Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to preserve white spaces? #107

Open
mrmacete opened this issue Jul 4, 2024 · 0 comments
Open

Is it possible to preserve white spaces? #107

mrmacete opened this issue Jul 4, 2024 · 0 comments

Comments

@mrmacete
Copy link

mrmacete commented Jul 4, 2024

Apparently all white spaces are lost at parse time because of this:

https://github.com/darylldoyle/svg-sanitizer/blob/master/src/Sanitizer.php#L105

$this->xmlDocument->preserveWhiteSpace = false;

is this vital to sanitisation or does it make sense to have it configurable (or even true by default) ?

there are legit SVG files, like the ones produced by the freeze tool [0] which rely on white spaces to properly format textual content sampled from terminals, and would be great to support them all the way down to WordPress sanitisation, as those are great for technical blogposts!

[0] https://github.com/charmbracelet/freeze/tree/main

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant