Repository navigation
Adding id attribute to text or headings #174
Answered
by
i-just
thomascoppein
asked this question in
Q&A
DescriptionIs there a way to add an id to text or heading so it can be targeted by anchor link? |
Answered by
i-just
Mar 15, 2024
Replies: 2 comments 1 reply
|
Hi, thanks for reaching out! You could use the anchors plugin to add anchor links to selected heading levels. Adding custom IDs or other attributes directly in CKEditor is not currently supported: ckeditor/ckeditor5#7369, but someone has created a plugin that adds the ability to add an id attribute: https://github.com/rhysstubbs/ckeditor5-add-attribute-to-element. You could use that as a starting point to create your own or pull in this one yourself. |
0 replies
Answer selected by
thomascoppein
|
This is now supported via the Bookmark button for anyone needing this |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Hi, thanks for reaching out! You could use the anchors plugin to add anchor links to selected heading levels.
Adding custom IDs or other attributes directly in CKEditor is not currently supported: ckeditor/ckeditor5#7369, but someone has created a plugin that adds the ability to add an id attribute: https://github.com/rhysstubbs/ckeditor5-add-attribute-to-element. You could use that as a starting point to create your own or pull in this one yourself.