As of HTML 5 anchor tags can contain block-level elements but CKEditor 4 does not support (some?) HTML 5 concepts.
Before CKEditor 4 was separated to a contrib module (drupal 8) the solution was to add
CKEDITOR.dtd['a']['div'] = 1;
CKEDITOR.dtd['a']['p'] = 1;
(source https://drupal.stackexchange.com/questions/252058/wrapping-content-in-an..., https://stackoverflow.com/questions/19825802/how-to-configure-ckeditor-t...)
but this no longer seems to work.
Is there a reason the above fix is not working?
Can we make the HTML 5 anchor work in some other way?
I would like to be able to wrap div and p elements in anchor tags with CKEditor.
Edit a CKEditor field.
Go to source and type <a href="#"><p>Lorem ipsum</p></a>
Go to view mode and back to source.
The result is
<p> </p>
<p><a href="#">Lorem ipsum</a></p>
<p> </p>
Active
1.0
Code