Skip to content

Content Editor: Temporarily ignore HTML comments in client-side parser

What does this MR do and why?

NOTICE: These changes are behind the preserve_unchanged_markdown feature flag.

This MR temporarily ignores HTML comments in the client-side Markdown parser used by the Content Editor. This change is temporary because we will implement support for editing HTML comments in future iterations. The current behavior of the Content Editor is failing when it finds an HTML comment inside a Markdown document.

Follow-up issue to implement proper HTML comments support: #342173 (closed)

Screenshots or screen recordings

Before After
2022-07-13_15.12.32 2022-07-13_15.12.09

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Enable the preserve_unchanged_markdown feature flag.
  2. Edit or create a Wiki page
  3. Paste the following snippets in the Classic Markdown Editor:
    <![CDATA[
      function matchwo(a,b)
      {
         if (a < b && a < 0) then {
           return 1;
         } else {
           return 0;
         }
      }
     ]]>
    
     This is a comment
    
     <!-- This is a comment -->
  4. Switch to the Content Editor. The Content Editor should remove the HTML comments.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #365292 (closed)

Edited by Enrique Alcántara

Merge request reports