Skip to content

fix(core/structure): propagate custom heading ID to section element#5281

Draft
marcoscaceres wants to merge 1 commit into
mainfrom
fix/4947-section-heading-id
Draft

fix(core/structure): propagate custom heading ID to section element#5281
marcoscaceres wants to merge 1 commit into
mainfrom
fix/4947-section-heading-id

Conversation

@marcoscaceres
Copy link
Copy Markdown
Contributor

Closes #4947

When a heading has an explicit id and its section has none, move
the id from the heading to the section.

When a heading has a custom ID (e.g., from {#custom-id} markdown
syntax), move it to the wrapping section element instead of generating
a separate auto-ID from the heading text. This ensures section and
heading share one canonical ID for fragment navigation and tools
like webref that expect section-level IDs.

Closes #4947
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.

Sections getting different ids from their headings

1 participant