Preserve leading spaces in code

What does this MR do and why?

Preserve leading spaces in code

In RTE, when coming from a plain text editor, if an inline code block contains leading spaces, preserve them. Also make sure they are preserved after serialization.

Changelog: fixed

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

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

Before After
image.png image.png

How to set up and validate locally

  1. In a text box, using plain text editor, type in an inline code block with leading spaces. Example: ` code`.
  2. Switch to RTE. The leading spaces should be preserved.
  3. Add some text to RTE.
  4. Switch back to plain text editor. The leading spaces should still be preserved.

Related to #442106 (closed)

Edited by Himanshu Kapoor

Merge request reports

Loading