Details
-
Bug
-
Resolution: Duplicate
-
Blocker
-
None
-
1.35
-
None
-
Unknown
-
Description
Try entering this code into the Code Macro
<html>
<body>
<div class="assasafasfasassasafasfasassasafasfasassasafasfasassasafasfasassasafasfasassasafasfasassasafasfasassasafasfasassasafasfasassasafasfasassasafasfasassasafasfasassasafasfasassasafasfasassasafasfas"></div>
</body>
</html>
When viewing the page or when editing the wiki syntax the internal div is lost.
{{code language="css" layout="LINE_NUM"}} <html> <body></body> </html> {{/code}}
Doesn't matter the language or the layout options.
Attachments
Issue Links
- duplicates
-
XWIKI-21868 Failing to properly save content when a macro contains the "<?" characters
-
- Closed
-
The long CSS class name is not relevant. You can reproduce the issue with:
The issue is in the CKEditor code, here https://github.com/ckeditor/ckeditor-dev/blob/4.11.4/core/editable.js#L815 . When the ignoreEmptyParagraph configuration option is on (which is the default) then CKEditor removes empty "paragraphs" (it actually removes empty DIVs also, here "paragraph" is taken semantically). Unfortunately it does this using a regular expression which matches HTML inside comments, like the one used to mark the macro output:
The root issue is that the HTML is not encoded in the macro markers comments. This makes it a duplicate of
CKEDITOR-100. HTML special characters don't have to be encoded inside comments but it would prevent multiple issues with CKEditor. Changing this on the Rendering side is not easy because it breaks backward compatibility.