Add front-matter support to wiki pages
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
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
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.
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done