1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-07-17 17:08:36 +00:00

fix(sanitizer): non-allowed attributes are not properly stripped

Regression introduced in commit 58178d90cb
This commit is contained in:
Frédéric Guillot 2025-01-22 20:44:41 -08:00
parent e74d875d95
commit 1faccc7eca
2 changed files with 15 additions and 3 deletions

View file

@ -685,3 +685,13 @@ func TestHiddenParagraph(t *testing.T) {
t.Errorf(`Wrong output: "%s" != "%s"`, expected, output)
}
}
func TestAttributesAreStripped(t *testing.T) {
input := `<p style="color: red;">Some text.<hr style="color: blue"/>Test.</p>`
expected := `<p>Some text.<hr/>Test.</p>`
output := Sanitize("http://example.org/", input)
if expected != output {
t.Errorf(`Wrong output: "%s" != "%s"`, expected, output)
}
}