Skip to content

Respect ID in heading with HeadingPermalinkExtension - #1160

Merged
colinodell merged 2 commits into
thephpleague:2.10from
ChloeSartorelli:pulls/2.10/heading-ids
Oct 17, 2026
Merged

colinodell merged 2 commits into
thephpleague:2.10from
ChloeSartorelli:pulls/2.10/heading-ids

Conversation

@ChloeSartorelli

Copy link
Copy Markdown
Contributor

If the AttributesExtension applies an ID to a heading, and the HeadingPermalinkExtension would normally add the ID to the heading, respect the ID from the AttributesExtension instead.

I've opted to still add the id and anchor prefixes, as it seems appropriate to respect those settings.

Fixes #1159

I don't know what the "lowest maintained branch" that this applies to is. If you'd like me to retarget this to a specific branch please let me know.

ChloeSartorelli added a commit to creative-commoners/silverstripe-userdocs-admin that referenced this pull request Oct 6, 2026
Relies on github.com/thephpleague/commonmark/pull/1160 for custom
anchors in headings
@ChloeSartorelli

Copy link
Copy Markdown
Contributor Author

CI failures are unrelated to this PR

ChloeSartorelli and others added 2 commits October 17, 2026 15:54
If the AttributesExtension applies an ID to a heading, and the
HeadingPermalinkExtension would normally add the ID to the heading,
respect the ID from the AttributesExtension instead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@colinodell
colinodell force-pushed the pulls/2.10/heading-ids branch from f2158dd to 0ae19e3 Compare October 17, 2026 19:55
@colinodell
colinodell enabled auto-merge (squash) October 17, 2026 19:56
@colinodell
colinodell merged commit 0292264 into thephpleague:2.10 Oct 17, 2026
17 of 18 checks passed
@ChloeSartorelli
ChloeSartorelli deleted the pulls/2.10/heading-ids branch October 18, 2026 22:00
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.

HeadingPermalinkExtension doesn't respect IDs from AttributesExtension

2 participants