You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When typing in the main editor, not in source mode, if i type in $> then change to source mode the $> is changed to </body>gt; . Seemingly this is because the > is changed to > and then seemingly the verion 5 html normalization model changes $& to </body> so $> becomes </body>gt;.
So my original html that i pass into the editor is: "<html><head><title></title></head><body><style>#activate a,#activate a:hover {color: #ffffff!important;text-decoration: none!important;text-decoration-color: #ffffff!important;}</style><p style="font-size: 16px; font-family: Helvetica, Arial, sans-serif;">Hello, <$FirstName$>. </p><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><table border="0" cellspacing="0" cellpadding="0" id="activate"><tr><td align="center" style="border-radius: 3px;" bgcolor="#ff8820"><a title="Activate" href="<$Link$>" target="_blank" style="font-size: 16px; font-family: Helvetica, Arial, sans-serif; color: #ffffff !important; text-decoration: none; text-decoration: none;border-radius: 3px; padding: 12px 18px; border: 1px solid #ff8820; display: inline-block;"><span style="color:#FFFFFF !important;">Click here to begin ►</span></a><!-- _!txtlnk!_ <$SubLink$> --></td></tr></table></td></tr></table><p style="font-size: 16px; font-family: Helvetica, Arial, sans-serif;">Have a good day</p></body></html>"
<$FirstName$> becomes <$FirstName</body>gt; in source mode
<!-- _!txtlnk!_ <$SubLink$> --> is completely removed and shouldnt be
Source code is normalized in ways we dont want it to be.
❓ Possible solution
Change HTML normalization to avoid these unwanted changes.
📃 Other details
Browser: Chrome
First affected CKEditor version: unsure first but we are using "ckeditor5": "^43.2.0" - but an old project we have is using ckeditor4 and it works as expected/doesnt cause HTML normalization issues
andybayer-grp
changed the title
CKEditor 5 HTML normalization leading to bugs/unwanted html elements
CKEditor 5 HTML normalization leading to bugs/unwanted html modification
Nov 13, 2024
📝 Provide detailed reproduction steps (if any)
When typing in the main editor, not in source mode, if i type in $> then change to source mode the $> is changed to </body>gt; . Seemingly this is because the > is changed to > and then seemingly the verion 5 html normalization model changes $& to </body> so $> becomes </body>gt;.
"<html><head><title></title></head><body><style>#activate a,#activate a:hover {color: #ffffff!important;text-decoration: none!important;text-decoration-color: #ffffff!important;}</style><p style="font-size: 16px; font-family: Helvetica, Arial, sans-serif;">Hello, <$FirstName$>. </p><table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td><table border="0" cellspacing="0" cellpadding="0" id="activate"><tr><td align="center" style="border-radius: 3px;" bgcolor="#ff8820"><a title="Activate" href="<$Link$>" target="_blank" style="font-size: 16px; font-family: Helvetica, Arial, sans-serif; color: #ffffff !important; text-decoration: none; text-decoration: none;border-radius: 3px; padding: 12px 18px; border: 1px solid #ff8820; display: inline-block;"><span style="color:#FFFFFF !important;">Click here to begin ►</span></a><!-- _!txtlnk!_ <$SubLink$> --></td></tr></table></td></tr></table><p style="font-size: 16px; font-family: Helvetica, Arial, sans-serif;">Have a good day</p></body></html>"
Then when i click source mode i see:
✔️ Expected result
I would expect <$FirstName$> to be <$FirstName$> in source mode
<!-- _!txtlnk!_ <$SubLink$> --> is completely removed and shouldnt be
❌ Actual result
<$FirstName$> becomes <$FirstName</body>gt; in source mode
<!-- _!txtlnk!_ <$SubLink$> --> is completely removed and shouldnt be
❓ Possible solution
Change HTML normalization to avoid these unwanted changes.
📃 Other details
plugins: [
AccessibilityHelp,
Alignment,
Autoformat,
AutoImage,
Autosave,
BlockQuote,
Bold,
CloudServices,
Code,
Essentials,
FontBackgroundColor,
FontColor,
FontFamily,
FontSize,
FullPage,
GeneralHtmlSupport,
Heading,
ImageBlock,
ImageCaption,
ImageInline,
ImageInsertViaUrl,
ImageResize,
ImageStyle,
ImageTextAlternative,
ImageToolbar,
ImageUpload,
Indent,
IndentBlock,
Italic,
Link,
LinkImage,
List,
ListProperties,
MediaEmbed,
Paragraph,
PasteFromOffice,
SelectAll,
SourceEditing,
Strikethrough,
Table,
TableCaption,
TableCellProperties,
TableColumnResize,
TableProperties,
TableToolbar,
TextPartLanguage,
TextTransformation,
TodoList,
Underline,
Undo
],
If you'd like to see this fixed sooner, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: