Skip to content

Support parsing link and image references in the Content Editor

Enrique Alcántara requested to merge 360946-deserialize-link-references into master

What does this MR do and why?

NOTICE: These changes are behind the preserve_unchanged_markdown feature flag.

It implements parsing support for link references and image references in the client-side Markdown deserializer in the Content Editor.

NOTICE 2: Please, have in mind that this MR doesn’t implement support for editing link and image references. That’s why using the bubble menus to edit the link’s href or the image’s URL will generate incorrect Markdown.

Context

This MR is part of the effort to implement a client-side Markdown parser for the Content Editor. This client-side Markdown parser is necessary to preserve unchanged parts of a Markdown document

Screenshots or screen recordings

Content type Before After
Link link_reference_before link_reference_after
Image image_reference_before image_reference_after

How to set up and validate locally

  • Enable the preserve_unchanged_markdown feature flag.
  • Create or Edit a Wiki page.
  • Define image or link references per the GFM spec in the Classic Markdown Editor
  • Switch to "Rich text" mode.
  • Add some text next to the link or change the image’s alternative text.
  • Switch back to Source mode. You will notice that the Content Editor generates the correct syntax for image and link references.

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

Edited by Enrique Alcántara

Merge request reports