# Avoid a byte order mark before frontmatter (EK00058)

import { Aside, Badge } from '@astrojs/starlight/components';

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?

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.

## What EkLine flags

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.

## How to fix

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".

<Aside type="note">
Some editors add a BOM automatically when they save as UTF-8. Check your editor's default encoding if the mark keeps returning after you remove it.
</Aside>

## FAQ

### Why is my frontmatter showing as text?

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.

### How do you remove a byte order mark?

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".

## Rule details

| Property | Value |
|----------|-------|
| Rule ID | `EK00058` |
| Category | Frontmatter and metadata |
| Default severity | <Badge text="Error" variant="danger" /> |
| Enabled by default | Yes |

## Ignore this rule

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](/reviewer/configuration/ignoring-rules/#ignore). To skip the check on a single file, add an inline comment at the top:

```markdown
<!-- ekline-ignore-next-line EK00058 -- BOM required by a downstream tool -->
```

## Related rules

- [EK00300](/reviewer/rules/ek00300/) — Enable dictionary-based spell checking