Closed Yexiaoxing closed 8 months ago
The old editor does rely on comment when cut/copy. So you need to enable comment in DOMPurify config as well.
The new Content Model editor (https://microsoft.github.io/roosterjs/index.html?cm=1) does not rely on comment.
@JiuqingSong I understand that comment is needed in old mode, can we state it somewhere in the document, or warn user when it happens?
Please feel free to submit a PR about this. You can add comment to the trustHTMLHandler code or type declaration.
Thanks.
Close old bug without new replies, and given that we are deprecating old editor and replace with new editor based on Content Model which doesn't have this issue anymore, we won't fix this one.
Describe the bug
When we have trusted thpes default policy on, and the createHTML filters comment out, the copy action will fail.
To Reproduce
Enable trusted types default policy as follows:
And try to copy in editor, it will fail.
Expected behavior
Roosterjs relys on comment node to save start and end selection data. Maybe throw a console warning when the data is missing?
Related code:
Screenshots n/a
Device Information
Additional context Add any other context about the problem here.