Handle undefined body and html for rte
What does this MR do and why?
Handles undefined body and html for rte
When the body and html from the render markdown response are
undefined, fall back to an empty string
In the case that the markdown text is \n\n, the /preview_markdown response will have an empty string as the body and a missing html value. Previously, this would result in the body becoming undefined (as body from the response is falsy, causing a short-circuit to the undefined html value).
This change makes the case described above fall back to an empty string, which would be the expected outcome.
References
Please include cross links to any resources that are relevant to this MR. This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
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 |
|---|---|
| Screen_Recording_2025-03-11_at_10.15.42 | Screen_Recording_2025-03-11_at_10.16.15 |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
Relates to #523885 (closed)