Files
grecia/config/initializers
Javi Martín cbf11c2514 Use Rails::HTML5::Sanitizer when sanitizing HTML
Since we use a version of Loofah supporting HTML5 since db2d0bb80, the
`Rails::HTML::Sanitizer.best_supported_vendor` method will return the
HTML5 sanitizer. As mentioned in the pull request introducting this
change [1], the libxml2 maintainer wrote:

> it's still a bad idea to use a 20+ years old, unmaintained HTML 4
> parser to sanitize input for the modern web

So we're going with the new default sanitizer.

Note we aren't uncommenting the `action_text.sanitizer_vendor` option
because we don't use Action Text and so it doesn't affect us , and
uncommeting it will raise an error.

Also note we need to change one test because the new sanitizer handles
whitespace slightly differently.

[1] Pull request 48293 in https://github.com/rails/rails
2025-05-20 15:38:52 +02:00
..
2024-11-13 15:55:20 +01:00
2020-06-16 13:47:38 +02:00
2023-10-24 19:00:43 +02:00
2023-11-23 18:21:29 +01:00
2024-04-15 15:39:23 +02:00
2017-04-03 12:30:57 +02:00
2025-05-20 13:12:29 +02:00
2025-03-05 15:40:03 +01:00