respec icon indicating copy to clipboard operation
respec copied to clipboard

Support formatting of section headers above h6, correct computation of level

Open sglaser opened this issue 4 years ago • 4 comments

Headers above h6 will be of form <h6 class="h7"> so css can do magic.

The level computation assumed section numbers and appendix numbers were a single digit/character

sglaser avatar Feb 25 '20 05:02 sglaser

I'll add a test for this. Please review but don't merge yet.

sglaser avatar Feb 25 '20 06:02 sglaser

I'm a bit concerned about the accessibility implications of this. As per following page from WAI wiki, the recommended way of supporting heading level beyond h6 is:

<div role="heading" aria-level="7">Jonagold/div>

Also see: https://stackoverflow.com/questions/55891025/is-h6-aria-level-7-a-reliable-way-to-create-a-h7-element

If it's fine to treat all headings above h6 as h6, I think this would be fine though.

sidvishnoi avatar Feb 25 '20 09:02 sidvishnoi

I understand the implications of deep nesting. I’m faced with an existing specification that I can’t change that uses h7.

I’ll fix the “bug” where I unnecessarily checked for an empty classList.

Steve Glaser [email protected] On Feb 25, 2020, 1:21 AM -0800, Sid Vishnoi [email protected], wrote:

I'm a bit concerned about the accessibility implications of this. As per following page from WAI wiki, the recommended way of supporting heading level beyond h6 is:

Jonagold/div> Also see: https://stackoverflow.com/questions/55891025/is-h6-aria-level-7-a-reliable-way-to-create-a-h7-element If it's fine to treat all headings above h6 as h6, I think this would be fine though. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

sglaser avatar Feb 25 '20 16:02 sglaser

@stevefaulkner or @patrickhlauke, we could use your guidance here: if we want a "h7", should we do <h6 aria-level="7"> or just use a <div role="heading" aria-level="7"></div>?

marcoscaceres avatar Feb 27 '20 06:02 marcoscaceres