Skip to content

Avoid a byte order mark before frontmatter (EK00058)

A stray byte order mark stops frontmatter from applying and renders it as text. Learn how to fix this file-encoding issue in your documentation.

Frontmatter applies only when the file starts with the opening fence, so save your documentation files as UTF-8 without a byte order mark (BOM). EkLine flags a BOM at the very start of a file, right before the frontmatter fence (rule EK00058), because it stops the metadata from parsing and renders it as visible text.

Why does frontmatter render as text instead of applying?

Section titled “Why does frontmatter render as text instead of applying?”

Frontmatter carries the title, description, and other metadata that your site builder reads to render a page. When a BOM sits before the opening fence, the parser no longer sees a valid frontmatter block, so the page loses its metadata and the raw fields show up in the body. This is a file-encoding problem, so it slips past a visual review of the prose and only appears once the page is built.

EK00058 detects a BOM before the opening frontmatter fence — the YAML --- or TOML +++ line at the top of the file.

The symptom is that the frontmatter block appears as plain text at the top of the rendered page rather than being applied as metadata. The cause is a BOM in front of the opening fence, which prevents the parser from recognizing the block.

Re-save the file as UTF-8 without a BOM. Most editors offer an encoding option, so select the plain “UTF-8” setting instead of “UTF-8 with BOM”.

A byte order mark before the opening fence stops the parser from recognizing the frontmatter, so the raw fields render as Markdown text instead of applying as metadata.

Re-save the file as UTF-8 without a BOM. Most editors offer a plain “UTF-8” encoding option separate from “UTF-8 with BOM”.

PropertyValue
Rule IDEK00058
CategoryFrontmatter and metadata
Default severityError
Enabled by defaultYes

A byte order mark is a file-level encoding issue, so the project-wide setting is the practical way to silence it. To disable the rule across your project, add EK00058 to the ignore list in your configuration file. To skip the check on a single file, add an inline comment at the top:

<!-- ekline-ignore-next-line EK00058 -- BOM required by a downstream tool -->
  • EK00300 — Enable dictionary-based spell checking