Releases: sitefinitysteve/semantic-heading-hierarchy
Release list
v1.2.0
What's New
healListHeadings option (default false)
Headings inside a multi-item list (a <ul>/<ol> with more than one <li>) are skipped by default — they're treated as repeated/uniform "card" content, so the first card isn't promoted above its siblings (these show up as data-heading-processed="skipped-list"). Set healListHeadings: true to evaluate and heal them like any other heading — useful when the list items are real content sections whose H1 → Hx jump must be corrected for accessibility.
healHeadings(container, { healListHeadings: true });Collapsible console summary
logResults output is now a single expandable group instead of a wall of lines:
- One header line:
🩺 healHeadings — N changed, N skipped, N total - A
console.tableoverview of every heading (from → to, state, class, text) - Per-heading lines that log the live DOM element as a second argument — click it in devtools to jump straight to the node in the Elements panel.
Prefer to drive your own output? The returned HealResult.headings array works directly with console.table(result.headings).
v1.1.0
This release adds several backwards-compatible features for inspecting and controlling heading healing. Existing callers are unaffected.
Features
-
promoteFirstHeadingoption — When a container has no<h1>, promote its first heading (H2–H6) up to H1 and cascade the rest down, instead of bailing. The promoted heading keeps its original visual size via thehs-Xclass.SemanticHeadingHierarchy.fix('.content-area', { promoteFirstHeading: true });
-
Structured
HealResultreturn value —fix()now returns an object describing every heading in document order (text,from,to,state,element), plusran,promotedFirstHeading, andmodifiedCount. Drop it straight intoconsole.table(result.headings). -
data-heading-processedattribute — Every heading the library evaluates is tagged with its outcome (anchor,promoted,changed,unchanged,skipped-list,ignored-before-h1,ignored-additional-h1) so you can confirm in devtools exactly what happened. -
logging.toggle()— Flip persistent (localStorage-backed) logging on/off and get the new state back. While global logging is on, an FYI reminder now prints at the end of each heal telling you how to turn it off.
Other
- Expanded README documentation and JSDoc.
tsconfigmodule resolution set toNodeNext.- 122 passing tests.
Full Changelog: https://github.com/sitefinitysteve/semantic-heading-hierarchy/commits/v1.1.0