Skip to content

Content Editor: Handle block and inline nodes wrapped with marks in client-side parser

Enrique Alcántara requested to merge 365292-handle-inline-nodes-with-marks into master

What does this MR do and why?

This MR improves the client-side Markdown parser/renderer in the Content Editor to handle cases where a mark wraps a block or inline node. We are using examples 137 and 539 of the GFM to test these scenarios:

Example 137

<del>

*foo*

</del>

Example 539

[![moon](moon.jpg)][ref]

[ref]: /uri

After this change, the client-side parser parses these Markdown examples and outputs the correct ProseMirror document.

Screenshots or screen recordings

Before After
Screen_Shot_2022-07-01_at_7.45.37_PM Screen_Shot_2022-07-01_at_7.43.51_PM
Screen_Shot_2022-07-01_at_7.45.37_PM Screen_Shot_2022-07-01_at_7.44.29_PM

How to set up and validate locally

  • Enable the preserve_unchanged_markdown feature flag.
  • Edit a Wiki page a paste the markdown snippets above in the Classic Markdown editor
  • Switch to the rich text editor.
  • The Content Editor is capable of handling the Markdown snippets

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 #365292 (closed)

Edited by Enrique Alcántara

Merge request reports