Skip to content

Preserve unchanged markdown in content editor

Himanshu Kapoor requested to merge 338338-preserve-unchanged into master

What does this MR do?

Issue: #338338 (closed)

The Content Editor forgets all the formatting preferences of a Markdown file when saving changes. This is because the Content Editor re-generates the entire Markdown source from the Markdown API output instead of only generating Markdown for the parts of the file that were edited in the editor.

After this commit, the content editor will retain original markdown for all blocks that were not touched by the user. For blocks that were touched, markdown transformation still applies.

How to setup and validate locally (strongly suggested)

  1. Create a new Wiki page.

  2. Type the below code:

     # Heading style 1 #
    
     Heading style 2
     ---------------
    
     You could bold with **asterisks** or you could bold with __underscores__.
     You could even bold with <strong>strong</strong> or <b>b</b> html tags.
     You could add newlines in your paragraph.
    
     You could italicise with *asterisks* or you could italicise with _underscores_.
     You could even italicise with <em>em</em> or <i>i</i> html tags.
    
     As long as you don't touch a paragraph, it will ~~discard~~ <s>destroy</s>
     <del>delete</del> <strike>remove</strike> preserve the original markdown style.
  3. Click "Use new editor".

  4. Click save without changing anything.

  5. The content editor will preserve your original markdown style for stuff you didn't change.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Related to #338338 (closed)

Edited by Himanshu Kapoor

Merge request reports