Skip to content

Fix source position mapping in markdown with frontmatter

What does this MR do and why?

Ensure that the spaces before and after the frontmatter are kept.

This allows the source-position data to be accurate. This is required for task lists

Fixes #353513 (closed)

How to set up and validate locally

  1. Create a new issue or merge request with the following description:
---
Some metadata
---


1. [ ] Check this.
2. [ ] Check this too!
  1. By inspecting the rendered HTML, it should be noted that the task items have the correct source position: data-sourcepos="6:1-8:0". Previously, the position would be incorrect: data-sourcepos="5:1-7:0"
  2. You should be able to check both tasks.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports