miniflux / v2

Minimalist and opinionated feed reader
https://miniflux.app
Apache License 2.0
6.44k stars 702 forks source link

sanitization: add support for HTML `hidden` attribute #2700

Closed JohnnyJayJay closed 1 week ago

JohnnyJayJay commented 1 week ago

This adjusts the Sanitize function to skip tags with the hidden attribute, similar to how it skips blocked tags and their contents.

From the whatwg HTML spec:

User agents should not render elements that are in the hidden state.

An alternative implementation would be to always propagate the hidden attribute to the sanitised HTML content, i.e., let the browser deal with hiding it.

Do you follow the guidelines?

JohnnyJayJay commented 1 week ago

I ran gofmt -s -w on the problematic file, should be good now.