Skip to content

Prevent serialization from failing in RTE

Himanshu Kapoor requested to merge 411525-malformed-links-serialization into master

What does this MR do and why?

Prevent serialization from failing in RTE

If there's a malformed link in the document, wrap it in a try/catch to prevent serialization (and therefore saving) from failing

Changelog: fixed

Screenshots or screen recordings

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

Before After
Screen Recording 2023-10-11 at 11.39.19.mov Screen Recording 2023-10-11 at 11.42.31.mov
Error in console, prevents saving of the document in its latest state No error in console. Document saves as expected

How to set up and validate locally

  1. In the rich text editor type in a URL with a stray % sign. Example: https://example.com/%
  2. Press space after the URL to trigger autolink.
  3. Try to save. Notice there might be some data loss as the anything you add after the link exists in the document isn't serialized, and hence saved.

MR acceptance checklist

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

Related to #411525 (closed)

Edited by Himanshu Kapoor

Merge request reports