Built-in

code-blocks

Fence languages and meta: `[filename]`, `{1,3-5}`, `diff`.

Fence languages and meta: [filename], {1,3-5}, diff.

import codeBlocks from 'comark-codemirror/plugins/code-blocks'

comark({ plugins: [codeBlocks()] })

What it adds

  • Completion in fence-lang, fence-meta
  • Snippets: Code block with file name

For agents

Included in llms():

Code blocks: ```lang [filename] {1,3-5} — an optional file name in brackets and highlighted lines in braces. Use diff for patches.

Copyright © 2026