Skip to content

fix: unify noToc/noTOC config to canonical noTOC#5264

Open
marcoscaceres wants to merge 5 commits intospeced:mainfrom
marcoscaceres:fix/5258-notoc-consistency
Open

fix: unify noToc/noTOC config to canonical noTOC#5264
marcoscaceres wants to merge 5 commits intospeced:mainfrom
marcoscaceres:fix/5258-notoc-consistency

Conversation

@marcoscaceres
Copy link
Copy Markdown
Contributor

Closes #5258

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 is normalized to noTOC in each profile's defaults module for backwards compatibility.

Verified in Safari: noToc: true correctly suppresses both the TOC and the fixup script.

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
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 of conf.noToc) when deciding whether to inject fixup.js.
  • Added per-profile defaults normalization to map legacy noToc → canonical noTOC.
  • Updated tests and Conf typings to reflect noTOC as the canonical option and mark noToc deprecated.

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.

Comment thread src/w3c/defaults.js Outdated
Comment thread src/aom/defaults.js Outdated
Comment thread src/dini/defaults.js Outdated
Comment thread src/geonovum/defaults.js Outdated
Comment on lines +253 to 257
it("shouldn't include fixup.js when noTOC is set", async () => {
const ops = makeStandardOps();
const newProps = {
noToc: true,
noTOC: true,
};
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added: test verifying noToc: true (legacy spelling) still suppresses fixup.js.

Comment thread tests/spec/geonovum/style-spec.js
Comment thread tests/spec/aom/style-spec.js
@marcoscaceres
Copy link
Copy Markdown
Contributor Author

@copilot Can you confirm all your feedback has been addressed? Can you fix anything that was not addressed?

1 similar comment
@marcoscaceres
Copy link
Copy Markdown
Contributor Author

@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.
@marcoscaceres marcoscaceres marked this pull request as ready for review May 5, 2026 04:13
marcoscaceres and others added 3 commits May 5, 2026 18:23
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.
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.

bug: config property noToc vs noTOC inconsistency

2 participants