Closed Bug 916444 Opened 11 years ago Closed 11 years ago

[Redesign] TOC doesn't work when <h3> without <h2>

Categories

(developer.mozilla.org Graveyard :: Design, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: teoli, Unassigned)

References

()

Details

Attachments

(1 file)

Attached image Borked TOC (deleted) —
Some pages have no <h2> but only <h3>. This is erroneous and we are fixing them little by little, but there are still 100s of them. (Though I expect a lot of these to be fixed by Christmas as the flattening of the JavaScript zone should happen until then). In this case, the TOC algorithm displays a fake empty 1. in the TOC. This shouldn't happen (and the <h3> should be displayed as 1. 2. 3. 4. )
This need to block the beta launch.
Yeah, this is a legacy issue, I believe. Not sure there's a great way around this.
If I could have the list of such pages, we could fix it. We want to fix these pages. Any way to find them?
(In reply to Jean-Yves Perrier [:teoli] from comment #3) > If I could have the list of such pages, we could fix it. We want to fix > these pages. Any way to find them? Hm. I don't think so, but if the devs can think of a way that'd be great.
Blocks: 927422
No longer blocks: 910513
The long term fix here is to fix the pages, but this is blocked by not being able to find them. Also I have no idea how many pages are affected. I guess about 50-60, a lot of them out-of-date. But that's a (slightly educated) guess. No actively maintained page should display this. A temporary fix gap would be not to display the <h2> in the ToC if empty. Habber, would this be acceptable? David is this doable without too much work/risk?
Flags: needinfo?(hhabstritt.bugzilla)
Flags: needinfo?(dwalsh)
This has been an issue for a long time. It should be fixed by a python expert dev. I could fix with JavaScript but that's really not ideal.
Flags: needinfo?(dwalsh)
Oh yes, you're right not js here, sorry. Asking groovecoder for the opinion about comment 5.
Flags: needinfo?(lcrouch)
(In reply to Jean-Yves Perrier [:teoli] from comment #5) > The long term fix here is to fix the pages, but this is blocked by not being > able to find them. Also I have no idea how many pages are affected. I guess > about 50-60, a lot of them out-of-date. But that's a (slightly educated) > guess. No actively maintained page should display this. Unfortunately I came across a lot of more pages, especially in the JavaScript area. I'm currently doing a lot of clean up (about 50+ pages in the last few days), so there is progress, but I expect the number of pages affected to be way bigger :/ Also note that old translated docs will probably have this, too. I dug into the TOC code some months ago. For quick reference the SectionTOCFilter lives here: https://github.com/mozilla/kuma/blob/master/apps/wiki/content.py#L588 Maybe "level" shouldn't be initialized with "2" but with the highest <hx> level that is found. But this method is quite complicated and I think can't come up with a quick PR without thinking about this a bit longer (plus tests) ;-)
There's a PR in for a find tool that uses refactored ElasticSearch: https://github.com/mozilla/kuma/pull/1578 Probably be live within a few days.
Flags: needinfo?(lcrouch)
There is the same problem if you have <h4> in <h2> without a <h3> and so on.
OS: Mac OS X → All
Hardware: x86 → All
Update from the writers here? Can we close this? Headings without structure are a massive a11y / readability issue.
Flags: needinfo?(hhabstritt.bugzilla)
This is no longer a huge issue since we've removed the numbers. The TOC still gets indented oddly, but it doesn't look nearly as bad. I think we can close this.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → WONTFIX
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: