First comment node is missing after calling DOMParser.parseFromString()
#9861
Labels
domain:v4-compatibility
This issue reports a CKEditor 4 feature/option that's missing in CKEditor 5.
package:engine
type:task
This issue reports a chore (non-production change) and other types of "todos".
Milestone
Provide a description of the task
This issue has been found during working on HTML comments.
The DOM string parsed by
HtmlDataProcessor#_toDom()
does not contain the first comment node, if it is the first node in the DOM string.This issue is caused because the return value from:
is a two-elements list:
NodeList [ p, <!--COMMENT 2--> ]
without the first comment node<!--COMMENT 1-->
. The first comment is somehow hoisted and inserted before the newly created HTML document:This issue could be fixed by wrapping the DOM string with a
<body>
or even better with a<div>
, just like it is done forBasicHtmlWriter#getHtml()
The text was updated successfully, but these errors were encountered: