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

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

sglaser
Copy link
Contributor

@sglaser sglaser commented Feb 25, 2020

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

Computation of nesting level assumed single digit / character section numbers.

Headers deeper than h6 will be of form <h6 class="h7">
@sglaser
Copy link
Contributor Author

sglaser commented Feb 25, 2020

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

src/core/structure.js Outdated Show resolved Hide resolved
@sidvishnoi
Copy link
Member

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.

@sglaser
Copy link
Contributor Author

sglaser commented Feb 25, 2020 via email

@marcoscaceres
Copy link
Contributor

marcoscaceres commented Feb 27, 2020

@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>?

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

Successfully merging this pull request may close these issues.

3 participants