Skip to content

Fix code block serialization in rich text editor

Himanshu Kapoor requested to merge himkp-serialize-markdown into master

What does this MR do and why?

Fix code block serialization in rich text editor

When a code block in rich text editor contains nested code blocks, it breaks on serialization. This commit ensures sufficient backticks are always added so that the serialized code block is always correct.

Changelog: fixed

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Consider the following example markdown code block:

This is JS code:

```js
var a = 0;
```
Case Before After
Serialized output (notice an extra backtick) image image
When rendered back image image

How to set up and validate locally

  1. Go to an issue, use rich text editor.
  2. Create a new code block, select Language as Markdown.
  3. Type in some markdown containing another code block.
  4. Save.

MR acceptance checklist

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

Merge request reports

Loading