Skip to content

CKEditor Anchor Link Documentation

A Drupal module that adds anchor support and a richer link dialog to CKEditor 5, so editors can create in-page jump targets and link to them without touching the HTML source.

CKEditor Anchor Link gives CKEditor 5 in Drupal an Anchor toolbar button. Editors place a named anchor anywhere in the body text, then link to it with a fragment (#my-anchor) from the same page or from anywhere else on the site.

An anchor is written as an id on the <a> element. The name attribute is also read, so content authored before id took over keeps working.

Key features

  • Anchor toolbar button: insert, edit and remove named anchors from the CKEditor 5 toolbar.
  • Invisible anchor markers: anchors with no text are flagged in the editor so authors can see and select them, while staying invisible on the front end.
  • Ids survive on real links: an <a href> that also carries an id keeps both, so a link can be a jump target too.
  • Source editing safe: anchor markup round-trips through the Source editing view without being stripped.
  • Backwards compatible: the legacy name attribute is supported alongside id, with a post update that widens the allowed HTML of formats already using the plugin.
  • Linkit integration: an optional matcher suggests #fragment targets in the Linkit autocomplete.
  • Themeable marker: the "INVISIBLE ANCHOR" label can be reworded or restyled entirely from CSS.

Getting started

For content editors

If you write content and need in-page navigation:

For site administrators

If you configure text formats and editor toolbars:

For developers

If you extend or integrate with the module:

Testing

Requirements

  • Drupal 10, 11 or 12
  • Drupal core CKEditor 5 and Text Editor modules
  • The vardot/ckeditor5-anchor-drupal plugin library (^1.0.3 || ^2.0.5), installed as a drupal-library

Need help?

  • Check the FAQ for common questions
  • Review the documentation section that matches your role
  • Search the issue queue before filing something new