feat: #3399656 Support the name attribute on anchors for backwards compatibility
Issue: https://www.drupal.org/project/anchor_link/issues/3399656
Allows <a name> in the plugin elements, and adds a post update that appends it to the allowed HTML of the text formats already using the plugin.
Reworked on top of 3.0.x, with one change to the original: the helper carries a module prefix (_anchor_link_append_to_filter_html_settings()) instead of the core name _ckeditor5_plugin_supports_more_elements_append_to_filter_html_settings(). Drupal 10 core defines a function with that exact name in ckeditor5.post_update.php, so the original would have fataled with a redeclaration when the updates ran there.
Testing
Drupal 11.4, Full HTML with the Anchor button:
drush updbrunsanchor_link_post_update_allow_anchor_name_attributecleanly,- a body containing
<a name="legacy-name">legacy name anchor</a>is upcast and saved as an anchor, - no JavaScript errors.
Checkpoints:
- File an issue
- Addition/Change/Update/Fix
- Testing to ensure no regression
- Automated unit testing coverage
- Automated functional testing coverage
- UX/UI designer responsibilities
- Readability
- Accessibility
- Performance
- Security
- Developer Documentation
- User Guide Documentation
- Reviewed by human
- Code review by maintainers
- Full testing and approval
- Credit contributors
- Review with the product owner
- Release notes snippet
- Release
AI-Generated: Yes
Edited by Rajab Natshah