Skip to content

Proposal: Fenced block quotes with an info string (e.g. to mark quoted LLM output) #834

Description

@frewsxcv

CommonMark has inline code blocks ` and fenced code blocks ``` fenced code blocks optionally with an info string. What if block quotes worked the same way?

Right now a multi-paragraph quote means sticking > at the front of every line. Fine when you're typing it, kind of annoying when you paste a few paragraphs in (from a PDF, an email, a chat window) and have to go back and add > to each one. A fence would let you wrap the whole thing once:

>>>
Some quoted text, pasted straight in.

Can run for a few paragraphs, and even hold a code block:

~~~
print("still inside the quote")
~~~
>>>

The part I'm particularly interested in here is the info string. With code fences you write ```python and most implementers turn that first word into a class, and the spec is clear it doesn't mandate what it means. A block-quote fence could carry the same sort of token: a source, an author, a URL for the cite attribute, whatever. I think this is especially relevant now, where there's a huge desire in the industry (and outside the industry!) to mark when text came from a language model. So something like

>>>ai
...or...
>>>claude

gives you a first-class way to say "this block is model output" instead of pasting it as plain text, or as a normal quote that reads like an actual person said it. Implementers could style or label it however they want, and the spec wouldn't have to pick a vocabulary, same as it doesn't define what python means.

Some prior art: there's a 2017 thread proposing exactly >>>. And GitLab Flavored Markdown has had multiline >>> blockquotes for years, and it's on the proposed-extensions wiki. One takeaway from that thread: >>> is indistinguishable from a blockquote nested three levels deep unless you add some rule that looks at the surrounding lines, which is why someone there ended up switching to <<<. I don't really care which delimiter wins. >>> reads best to me but whatever avoids the ambiguity is fine.

Is there any appetite for this in the spec? I'd be willing to open a pull request if so.

Activity

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