Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reader View in Safari broken #1557

Open
paddor opened this issue Jan 4, 2021 · 6 comments
Open

Reader View in Safari broken #1557

paddor opened this issue Jan 4, 2021 · 6 comments

Comments

@paddor
Copy link

paddor commented Jan 4, 2021

URL for broken page

https://git-scm.com/docs/git-rebase

Problem

When I start the Reader View in Safari, not all content of the man page is shown. On the git-rebase page for example, the Reader View starts at:

How to handle commits that are not empty to start and are not clean cherry-picks of any upstream commit [...]

Context

macOS 11.1 and Safari 14.0.2

Steps to Reproduce

Visit man page and click on "Show Reader View" in the address bar.

@pedrorijo91
Copy link
Member

Thank you for reporting the issue @paddor .

It's a strange one indeed.

we have a few other git man pages which are working fine under reader view (e.g. https://git-scm.com/docs/git-add), but also a few others with the same problem (e.g., https://git-scm.com/docs/git-status)

firefox reader view has problems with the same pages as well, so it's probably something page specific 🤔

@peff
Copy link
Member

peff commented Jan 4, 2021

Hrm. The firefox reader-mode view of the rebase page seems to start at the Options section. But weirdly sticks the token --committer-date-is-author-date in the header.

I don't know much about how reader mode is implemented, but I imagine it has to be based on some heuristics about what the "main" content of the page is. I'm open to the notion that our HTML is somehow broken or malformed, but looking at the decision firefox is making for the rebase page, I'm not sure how we could push the heuristics in a more useful direction.

@paddor
Copy link
Author

paddor commented Jan 4, 2021

https://superuser.com/questions/387572/how-does-safaris-reader-work-and-when-does-it-show-up

Looks like Safari just looks for a <div> with a heading inside followed by a certain amount of text.

@pedrorijo91
Copy link
Member

I expect only a few commands to have 2000+ chars in the description to make the reader render correctly.

I looked at the commands on the left column of https://git-scm.com/docs, and I'd say around ~50% have rendering problems.

I have no clue on how to improve this without a ton of re-work on man pages or HTML generation. Should we report this to chrome/firefox projects and see if there's any suggestion? I feel like git man pages are not the reader target as they are not composed of long text blocks....

@jnavila
Copy link
Contributor

jnavila commented Jan 6, 2021

As a matter of fact, running the 'git rebase' url through a web validator brings up some html errors:

http://git-scm.com/docs/git-rebase

https://validator.w3.org/nu/?doc=http%3A%2F%2Fgit-scm.com%2Fdocs%2Fgit-rebase

Mainly, the "All guides" entry has a malformed anchor.

Hypothesis: this could explain why some pages which were not updated at the last version render correctly while untouched others are well detected.

Edit: added validator page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@paddor @peff @jnavila @pedrorijo91 and others