Skip to content

Render frontmatter in the Content Editor

What does this MR do and why?

It implements render support for frontmatter in the Content Editor. Currently, the Content Editor renders frontmatter as code blocks. However, when saving changes, it doesn’t use the correct frontmatter syntax. This MR identifies frontmatter code blocks and generate the correct frontmatter syntax when saving changes.

This Content Editor stuff is new to me. Are there any references?

If it is your first time reviewing Content Editor changes, we recommend reading the development guidelines.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Edit or create a new Wiki page
  2. Before switching to the Content Editor, paste this frontmatter snippet in the Classic Editor
    ---
    title: Page title
    ---
    frontmatter
  3. Switch to the Content Editor. You should see the frontmatter rendered as an editable codeblock labeled as frontmatter frontmatter-content-editor
  4. You can edit the frontmatter code block and submit changes.
  5. The Content Editor should generate valid frontmatter syntax with your changes

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

Merge request reports