Fix preserve markdown logic for lists
What does this MR do and why?
Fix preserve markdown logic for lists
In RTE, if coming from the PTE with a bullet list and changing it to another list type like task list or numeric list, the change wouldn't apply. This was because even though the list type changed, all children of the list were unchanged. This commit changes the logic to check if the parent's list type has changed, the children should also be marked as changed.
Changelog: fixed
References
https://gitlab.slack.com/archives/C04R571QF5E/p1745931353555449
Screenshots or screen recordings
| Before | After |
|---|---|
| CleanShot 2025-06-17 at 13.54.39.mp4 | CleanShot 2025-06-17 at 13.53.44.mp4 |
How to set up and validate locally
- Enable feature flag
:preserve_markdown - In plain text editor, type in a bullet list with two items
- Switch to rich text editor
- Click Add a numbered list to change the bullet list to a numeric list
- Switch back to plain text editor
Previously, the list type would change back to bullet list in PTE. Now it stays as numeric list, as expected.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.