Skip to content

Add front-matter support to wiki pages

Alex Kalderimis requested to merge ajk-wiki-frontmatter into master

What does this MR do?

This MR supports parsing front-matter from wiki pages, so that pages can declare their titles and slugs.

The new functionality added here is:

  • parse (and strip) front-matter from wiki page content

Nothing is done with this data at the moment, but we will use it to define titles and slugs for pages.

A new feature flag is added to control this: :wiki_front_matter.

Related issue: #30758 (closed)

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

The primary risks are to do with handling YAML. Parsing YAML from users requires a high degree of care and suspicion, in order to avoid DOS and other attacks. Here we use safe_load which limits the types of data that may be loaded, and limit the document length (here very conservatively to 512 characters - this may need to be increased later).

We should additionally add support for this feature to be turned off at the project level and at the application level for security conscious customers, so this probably needs a new application and project setting.

Edited by Luke Duncalfe

Merge request reports