Enhancement
Critical
Major
Detail
Detail
Detail
#26125
Error "Invalid attribute name aria-label" in TL Doc after cut & paste
When editing a page, you can add a text with code snippet like this
(does not work, because only text) or like this
(does not work if there is no content after the snippet). There are no problems with this.
But if you mark like this
and copy and paste it somewhere, it looks like this
This empty line cannot be edited and looks like an empty <div> in F12-View. When trying to save, the following error may appear.
The empty <div> actually contains the attribute name aria-label.
Enhancement
Code snippets that are located at the beginning or end of the editor cannot currently be copied correctly in some cases. Also, partial copying of a snippet is not possible in some browsers (e.g. Chrome). The CKEditor team is currently working on a solution, so this is not considered here. Nevertheless, code snippets are currently copied incorrectly. If you are in edit mode when copying, then also unwanted images are copied, such as the drag & drop image, which does not belong to the source code itself and therefore should not be inserted. That this is currently happening can be seen by the fact that two messages about the successful upload are displayed. Also the DIV with the unwanted aria-label is actually only a part of the highlighting function of the editor and has nothing to do in the source code, ergo should not be copied. Therefore, the API has now been changed so that code snippets are recognized, the actual code is extracted and then inserted. The editor takes care of the highlighting and the snippet looks exactly like the original, but without unwanted highlighting code in the actual source code.
Test
Copy and paste a code snippet in edit mode. There should be no message about a successful file upload, nor should there be an error message about the aria-label when saving.