Fix code block serialization in rich text editor
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) | ||
When rendered back |
How to set up and validate locally
- Go to an issue, use rich text editor.
- Create a new code block, select Language as Markdown.
- Type in some markdown containing another code block.
- 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.
-
I have evaluated the MR acceptance checklist for this MR.