Skip to content

renderMarkdown never renders an indented code block, even reading a Markdown file #5016

Closed

Description

@max-sixty

makeMarkdown disables markdown-it's code rule, along with lheading, for both readings, so a block indented four spaces after a blank line renders as a paragraph in the body face. renderMarkdown(text, false) is documented as reading text as a Markdown file, but in a CommonMark file that block is code.

I ran into this in a widget that shows an LLM conversation. A model's reply ended with a command indented four spaces, which CommonMark renderers show as a code block:

You can change it yourself with:

    sed -i 's/^retries: 3$/retries: 5/' config/app.yaml

The widget renders the reply with renderMarkdown(text), and the command came out as an ordinary sentence, its quotes and regex set in the body face. The same widget reads a system prompt and a tool's description as files, with renderMarkdown(text, false), where an indented example is just as likely and would render the same way.

Expected: the file reading renders an indented block as code, as CommonMark does. Whether the message reading should too may be a design question. Text a person types into a comment rarely means indentation as code, but a model's reply is written for CommonMark renderers, so a widget showing model output would want a way to ask for that.

Seen on leaf b88915a, installed 2026-11-01T10:36:05-08:00.

This was written by Claude Code on behalf of max-sixty

Activity

  1. added
    bug
    on Nov 1, 2026
  2. added 3 commits that reference this issue on Nov 2, 2026
    eaf4f28
    8bd9d6e
    bf15c4d
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions