Skip to content

📝 Markdown formatter removes the spaces around text after a code span that wraps across lines in a blockquote #13027

Description

@vgerasymenko

Inside a blockquote, a code span that wraps onto the next > line loses the space after its closing backtick, and the next code span loses the space before it, so the words between them run into both spans.

Input:

> The session logs `Error: Unsupported item type:
> agent_config_update` thrown by `livekitItemToOpenAIItem` via
> `createChatCtxUpdateEvents`.

After biome format --write (one pass):

> The session logs `Error: Unsupported item type:
> agent_config_update`thrown by`livekitItemToOpenAIItem` via
> `createChatCtxUpdateEvents`.

Expected: the text is unchanged: agent_config_update` thrown by `livekitItemToOpenAIItem` keeps both spaces. Outside a blockquote the same paragraph keeps them.

Found while formatting a documentation repository with Biome 2.6.6's Markdown formatter (enabled by default since 2.6.2); the reproduction above is minimal and uses the default configuration.

Environment information

Details
CLI:
  Version:                      2.6.6
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           windows

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:           v24.21.0
  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

Configuration

{}

Playground link

https://biomejs.dev/playground/#files.codespan-in-quote.md=PgAgAFQAaABlACAAcwBlAHMAcwBpAG8AbgAgAGwAbwBnAHMAIABgAEUAcgByAG8AcgA6ACAAVQBuAHMAdQBwAHAAbwByAHQAZQBkACAAaQB0AGUAbQAgAHQAeQBwAGUAOgAKAD4AIABhAGcAZQBuAHQAXwBjAG8AbgBmAGkAZwBfAHUAcABkAGEAdABlAGAAIAB0AGgAcgBvAHcAbgAgAGIAeQAgAGAAbABpAHYAZQBrAGkAdABJAHQAZQBtAFQAbwBPAHAAZQBuAEEASQBJAHQAZQBtAGAAIAB2AGkAYQAKAD4AIABgAGMAcgBlAGEAdABlAEMAaABhAHQAQwB0AHgAVQBwAGQAYQB0AGUARQB2AGUAbgB0AHMAYAAuAAoA

Code of Conduct

  • I agree to follow Biome's Code of Conduct
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