Skip to content

Content Editor: Support frontmatter in client-side deserializer

What does this MR do and why?

NOTICE: This change is behind the preserve_unchanged_markdown feature flag.

It adds support for client-side deserialization of front matter blocks in the Content Editor. This MR also adds front matter examples to the GitLab Flavored Markdown specification.

glfm_specification/snapshot_examples files

All the files in this directory are auto-generated using the following script: https://docs.gitlab.com/ee/development/gitlab_flavored_markdown/specification_guide/#update-example-snapshotsrb-script. I recommend reading the documentation to understand the process.

The file manually updated is glfm_specification/input/gitlab_flavored_markdown. We added the front matter examples to that file and the scripts generate snapshot tests based on those examples.

Screenshots or screen recordings

Before After
2022-08-10_12.14.50 2022-08-10_12.13.59

How to set up and validate locally

  • Enable the preserve_unchanged_markdown feature flag.
  • Create or edit a Wiki page
  • Insert a frontmatter codeblock in the Classic Markdown Editor
    ---
    title: Page Title
    ---
  • Switch to the Content Editor.
  • You will notice that front matter code block is displayed correctly in the Content Editor

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

Edited by Enrique Alcántara

Merge request reports