Skip to content

[bug] Preserve fenced-code highlighting inside Markdown block quotes #131

Description

@owainlewis

Goal

Preserve fenced-code and injected-language context when a Markdown fence is nested in a block quote and its opener is above the viewport.

Evidence

At exact main 1d6d60189e4b350649f591a858746368de78064c, markdown_fence and markdown_fence_closes in src/highlighter.rs only trim up to three spaces and require the fence marker to be the first remaining byte. A valid line such as > ```rust is not recognized, so deep bounded viewports are seeded as normal Markdown and lose injected Rust highlighting.

Original review thread: #119 (comment)

Acceptance criteria

  • Markdown checkpoint scanning recognizes opening and closing fenced blocks inside block quotes.
  • Container prefixes are handled consistently on the opener, contents, and closer.
  • Deep viewports preserve injected Rust highlighting when the quoted opener is above the window.
  • Ordinary unquoted fences and bounded-work guarantees remain unchanged.

Checks

  • Add focused shallow and deep regressions for quoted backtick and tilde fences, including injected Rust.
  • Cover closing the quoted fence inside the visible window and editing a container prefix.
  • Run focused highlighter tests and opt-in highlighting performance checks.
  • Run cargo fmt --check, cargo test --all-targets, strict Clippy, and an all-target build.

Scope

Support block-quote container prefixes without implementing a complete Markdown parser in the checkpoint scanner.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfactory-readyClear, focused, unblocked work an agent may implement

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions