Rich text editor deletes HTML comments

Summary

When using the rich text editor to update descriptions, HTML comments that were added using the plain text editor are destroyed. I have confirmed that this happens with the following:

  1. Issue descriptions
  2. Epic descriptions

I would expect this to happen with any text field where the rich text editor is available and HTML comments are valid.

Steps to reproduce

  1. Make an epic or issue using the plain text editor
    • Ensure that there's an HTML comment somewhere in the description
  2. Edit the description
  3. Switch to rich text editing
  4. Add or remove any content
  5. Observe that HTML comments are deleted

You will see the edit in the activity feed (see my test here klang_ultimate_group/public/rich-editor-test-group&1).

Note: In at least one test, I definitely had an HTML comment that was deleted but did not show up in the activity feed edits, but I haven't been able to reproduce that.

Example Project

Example epic: klang_ultimate_group/public/rich-editor-test-group&1
Example issue: klang_ultimate_group/public/rich-editor-test-group/rich-editor-test-project#2 (closed)

What is the current bug behavior?

When using the rich text editor when HTML comments exist, the comments are deleted.

What is the expected correct behavior?

All content should be preserved by the rich text editor, even when not displayed.

Relevant logs and/or screenshots

Output of checks

This bug happens on GitLab.com. I have attempted to reproduce it on this issue as well.

Workaround

The comments seem to be preserved as long as you enter the plain text editor before saving.

Related issues

Edited by Keelan Lang