Skip to content

πŸ“ Markdown: formatEmbeds formats a fenced Markdown example's front matter as a paragraph, un-indenting its YAMLΒ #12679

Description

@awhitford

Environment information

Details
CLI:
  Version:                      2.6.3
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  BIOME_DISTRIBUTION:                npm
  BIOME_LOG_FILE:                    unset
  BIOME_LOG_PATH:                    unset
  BIOME_LOG_PREFIX_NAME:             unset
  BIOME_LOG_LEVEL:                   unset
  BIOME_LOG_KIND:                    unset
  BIOME_CONFIG_PATH:                 unset
  BIOME_THREADS:                     unset
  BIOME_WATCHER_KIND:                unset
  BIOME_WATCHER_POLLING_INTERVAL:    unset
  BIOME_BINARY:                      unset
  RUST_BACKTRACE:                    unset
  NO_COLOR:                     unset
  TERM:                         xterm-256color
  JS_RUNTIME_VERSION:           v26.12.1
  JS_RUNTIME_NAME:              node
  NODE_PACKAGE_MANAGER:         unset

Biome Configuration:
  Status:                       Loaded successfully.
  Path:                         biome.json
  Formatter enabled:            true
  Linter enabled:               true
  Assist enabled:               true
  VCS enabled:                  false
  HTML full support enabled:    unset

Formatter:
  Format with errors:           unset
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Attribute position:           unset
  Bracket spacing:              unset
  Includes:                     unset

JavaScript Formatter:
  Enabled:                      unset
  JSX quote style:              unset
  Quote properties:             unset
  Trailing commas:              unset
  Semicolons:                   unset
  Arrow parentheses:            unset
  Bracket spacing:              unset
  Bracket same line:            unset
  Quote style:                  unset
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Attribute position:           unset

JSON Formatter:
  Enabled:                      unset
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Trailing Commas:              unset
  Expand lists:                 unset

CSS Formatter:
  Enabled:                      unset
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Quote style:                  unset

GraphQL Formatter:
  Enabled:                      unset
  Indent style:                 unset
  Indent width:                 unset
  Line ending:                  unset
  Line width:                   unset
  Bracket spacing:              unset
  Quote style:                  unset

Files:
  Ignore Unknown:               unset
  Includes:                     unset

Workspace:
  Open Documents:               0

Configuration

{ "markdown": { "parser": { "frontmatter": true }, "formatter": { "enabled": true, "formatEmbeds": true } } }

Playground link

https://biomejs.dev/playground/?language=md#code=IwAgAEUAeABhAG0AcABsAGUACgAKAGAAYABgAG0AYQByAGsAZABvAHcAbgAKAC0ALQAtAAoAdABpAHQAbABlADoAIABSAGUAZgB1AG4AZAAgAHAAbwBsAGkAYwB5AAoAdgBlAHIAaQBmAGkAZQBkADoACgAgACAAYgB5ADoAIABoAHUAbQBhAG4AOgBqAGEAbgBlAEAAYQBjAG0AZQAuAGUAeABhAG0AcABsAGUACgAgACAAYQB0ADoAIAAyADAAMgA2AC0AMAA5AC0AMAAxAFQAMAAwADoAMAAwADoAMAAwAFoACgAtAC0ALQAKACMAIABSAGUAZgB1AG4AZAAgAHAAbwBsAGkAYwB5AAoAYABgAGAACgA%3D

The playground can't turn on markdown.parser.frontmatter, but the fenced example breaks either way. With the configuration above, biome format --write example.md turns this:

# Example

```markdown
---
title: Refund policy
verified:
  by: human:jane@acme.example
  at: 2026-09-01T00:00:00Z
---
# Refund policy
```

into this:

# Example

```markdown
---

title: Refund policy
verified:
by: human:jane@acme.example
at: 2026-09-01T00:00:00Z
---

# Refund policy
```

The fenced document's leading --- is read as a thematic break and its YAML as a paragraph, so the paragraph's continuation lines lose their indentation. That changes what the YAML means: verified becomes null, and by and at become top-level keys. markdown.parser.frontmatter: true applies to the file but not to embedded Markdown. The same happens with ```md and with a fence that has metadata (```markdown title="policy.md"). Front matter at the top of the file formats correctly.

Expected: embedded Markdown is parsed with the same options as the file, so its front matter is formatted as YAML and keeps its meaning. Failing that, Biome should leave a fenced Markdown block that starts with --- as written.

Code of Conduct

  • I agree to follow Biome's Code of Conduct

πŸ€– Generated with Claude Code

Activity

  1. added theissue type on Oct 25, 2026
  2. added
    A-Formatter
    S-Bug-confirmed
    L-Markdown
    on Oct 25, 2026
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

    A-FormatterL-MarkdownS-Bug-confirmed

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions