git-scm.com icon indicating copy to clipboard operation
git-scm.com copied to clipboard

Reader View in Safari broken

Open paddor opened this issue 4 years ago • 6 comments

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.

paddor avatar Jan 04 '21 10:01 paddor

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 🤔

pedrorijo91 avatar Jan 04 '21 12:01 pedrorijo91

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.

peff avatar Jan 04 '21 20:01 peff

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.

paddor avatar Jan 04 '21 20:01 paddor

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....

pedrorijo91 avatar Jan 06 '21 20:01 pedrorijo91

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

jnavila avatar Jan 06 '21 21:01 jnavila

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.

Tan11Tan avatar Dec 08 '22 14:12 Tan11Tan