fix: unify noToc/noTOC config to canonical noTOC#5264
fix: unify noToc/noTOC config to canonical noTOC#5264marcoscaceres wants to merge 5 commits intospeced:mainfrom
Conversation
The config property was split: style movers used `noToc` (lowercase c) while structure.js used `noTOC` (uppercase C). A spec author setting one would not affect the other. Canonical name is `noTOC` (matching the documentation and the acronym convention used by `edDraftURI`). The old `noToc` name is normalized to `noTOC` in each profile's defaults module for backwards compatibility. Closes speced#5258
There was a problem hiding this comment.
Pull request overview
This PR resolves a long-standing configuration inconsistency by standardizing TOC-suppression on the canonical noTOC flag across profiles (and their style “fixup.js” injection), while adding backwards compatibility for the legacy noToc spelling.
Changes:
- Updated W3C/AOM/DINI/Geonovum style modules to check
conf.noTOC(instead ofconf.noToc) when deciding whether to injectfixup.js. - Added per-profile defaults normalization to map legacy
noToc→ canonicalnoTOC. - Updated tests and
Conftypings to reflectnoTOCas the canonical option and marknoTocdeprecated.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/spec/w3c/style-spec.js | Renames test config from noToc to noTOC for fixup.js suppression. |
| tests/spec/geonovum/style-spec.js | Renames test config from noToc to noTOC for fixup.js suppression. |
| tests/spec/core/id-headers-spec.js | Updates comment wording to noTOC. |
| tests/spec/aom/style-spec.js | Renames test config from noToc to noTOC for fixup.js suppression. |
| src/w3c/style.js | Uses conf.noTOC to gate fixup.js injection. |
| src/w3c/defaults.js | Normalizes legacy noToc into noTOC. |
| src/type-helper.d.ts | Marks noToc as deprecated and reformats several type definitions. |
| src/geonovum/style.js | Uses conf.noTOC to gate fixup.js injection. |
| src/geonovum/defaults.js | Normalizes legacy noToc into noTOC. |
| src/dini/style.js | Uses conf.noTOC to gate fixup.js injection. |
| src/dini/defaults.js | Normalizes legacy noToc into noTOC. |
| src/aom/style.js | Uses conf.noTOC to gate fixup.js injection. |
| src/aom/defaults.js | Normalizes legacy noToc into noTOC. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| it("shouldn't include fixup.js when noTOC is set", async () => { | ||
| const ops = makeStandardOps(); | ||
| const newProps = { | ||
| noToc: true, | ||
| noTOC: true, | ||
| }; |
There was a problem hiding this comment.
Added: test verifying noToc: true (legacy spelling) still suppresses fixup.js.
|
@copilot Can you confirm all your feedback has been addressed? Can you fix anything that was not addressed? |
1 similar comment
|
@copilot Can you confirm all your feedback has been addressed? Can you fix anything that was not addressed? |
Only copy noToc into noTOC when noTOC is not already explicitly set. Add backward-compat tests verifying legacy noToc: true still suppresses fixup.js across all profiles.
The tests used simple.html which has its own embedded respecConfig that doesn't include noTOC. The external config passed via makeRSDoc doesn't override the embedded config when a custom HTML file is used. Fix by using the default makeRSDoc() without a custom file.
CI only built w3c and geonovum profiles, leaving AOM and DINI bundles stale from whatever was last committed. Tests for those profiles ran against outdated builds, causing false failures when source changes hadn't been reflected in the committed bundles.
Closes #5258
The config property was split: style movers used
noToc(lowercase c) whilestructure.jsusednoTOC(uppercase C). A spec author setting one would not affect the other.Canonical name is
noTOC(matching the documentation and the acronym convention used byedDraftURI). The oldnoTocis normalized tonoTOCin each profile's defaults module for backwards compatibility.Verified in Safari:
noToc: truecorrectly suppresses both the TOC and the fixup script.