golang/go

x/pkgsite: align attribute gets stripped from headings in README.md

Open

#51 045 ouverte le 7 févr. 2022

Voir sur GitHub
 (2 commentaires) (0 réactions) (0 assignés)Go (19 008 forks)batch import
NeedsFixhelp wantedpkgsite

Métriques du dépôt

Stars
 (133 883 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

What is the URL of the page with the issue?

https://pkg.go.dev/snai.pe/boa@v0.0.0-20220207080157-b18178b71668

What is your user agent?

Mozilla/5.0 (X11; Linux x86_64; rv:96.0) Gecko/20100101 Firefox/96.0

Screenshot

2022-02-07_09:52:35

What did you do?

Here is the source of the README: https://raw.githubusercontent.com/Snaipe/boa/9ac3c07bc342a675b3bd5dbda8ca58c5c5b0ea96/README.md

You'll notice on the first line that the <h1> tag has align="center".

What did you expect to see?

I expected the image to be centered. Github renders the image as such: https://github.com/Snaipe/boa/blob/9ac3c07bc342a675b3bd5dbda8ca58c5c5b0ea96/README.md

What did you see instead?

The image is not centered. It seems to be because the align attribute is not allowed in the sanitized HTML: https://github.com/golang/pkgsite/blob/a70a3c2b473c9294b83bc93a6068c8ebcc9c4ecb/internal/frontend/readme.go#L169

I think allowing the attribute on heading seems innocent enough. Thoughts?

Guide contributeur