Skip to content

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

@Snaipe

Description

@Snaipe

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.help wantedpkgsite

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions