Skip to content

UTF-8 BOM breaks YAML frontmatter parsing #712

Closed

Description

@drawmeanelephant

Suggested labels: bug, area: parser, upstream


Discovery audit finding L1 (low) — cooklang/cookcli @ 7c2f48b (v0.38.1), audited 2026-10-12. Repro verified. Root cause is in the cooklang dependency (a cooklang-rs issue at heart); a cookcli-side workaround (strip the BOM before parsing) is possible.

Summary

A UTF-8 BOM breaks YAML frontmatter parsing — the title is lost and the frontmatter becomes a phantom step.

Where

cooklang crate, parser/frontmatter.rs — the fence line \u{feff}--- isn't recognized. Note cooklang-find's menu parser does strip a BOM.

Repro

A recipe file starting with a UTF-8 BOM:

  • CLI shows step  title: BOM Recipe and no title
  • web UI shows metadata: {}

Expected

A BOM'd recipe parses identically to a non-BOM'd one (title from frontmatter).

Actual

The title is lost and the frontmatter becomes a phantom step.

Acceptance criteria (red → green)

  • Red: the BOM'd recipe renders with no title and a phantom title: step.
  • Green: the BOM'd recipe renders with its frontmatter title and no phantom step.

Verification

Executed repro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions