Skip to content

Markdown with YAML rendering doesn't handle UTF8 BOM

Summary

If you check in Markdown file with a UTF-8 BOM marker, it does not render a YAML header as a code block.

Steps to reproduce

  1. Create a Markdown file with a YAML header
  2. Make sure it has a BOM (using Notepad++ for example)
  3. Check it in
  4. Preview it

Example Project

https://gitlab.com/dmoonfire/gitlab-markdown-bom

What is the current bug behavior?

The BOM causes it not to correctly identify the YAML header and format at it.

What is the expected correct behavior?

It would treat files with and without BOM identically.

Relevant logs and/or screenshots

With BOM:

image

Without BOM:

image

Output of checks

This bug happens on GitLab.com.

Possible fixes

Sorry.