miniflux / v2

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

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

Closed JohnnyJayJay closed 5 months ago

JohnnyJayJay commented 5 months 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 5 months ago

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