lang-markdown

Markdown language support for the CodeMirror 6 code editor

Library
npm
v6.5.2
131stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
39/100Needs Attention
Development Activity12
Maintenance0
Community64
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
85/100Excellent
Architecture90
Code Quality88
Innovation85
Learning Curve78

@codemirror/lang-markdown is the official Markdown language package for CodeMirror 6. It wires the Lezer Markdown parser into CodeMirror’s language system, giving an editor CommonMark and GitHub Flavored Markdown parsing, syntax highlighting, section folding, and Markdown-aware editing commands.

Beyond parsing, the package layers in editor ergonomics: fenced code blocks can be highlighted with nested language parsers, HTML tags are completed as you type, pasted URLs become links over a selection, and Enter/Backspace continue or unwind list and blockquote markup. It ships as a small, tree-shakeable ES module with TypeScript types.

What You Get

  • A markdown() extension factory returning a CodeMirror LanguageSupport value
  • commonmarkLanguage and markdownLanguage (GFM plus subscript, superscript, and emoji) as ready-made Language values
  • Nested parsing of fenced code blocks via configurable code languages
  • Markdown editing commands and a keymap for continuing lists and blockquotes
  • HTML-tag autocompletion and a paste-URL-as-link extension

Common Use Cases

  • Adding a Markdown editing mode to a CodeMirror-based text or code editor
  • Building a documentation or note-taking app with live Markdown syntax highlighting
  • Highlighting fenced code blocks inside Markdown using other CodeMirror language packages
  • Providing GFM support (tables, task lists, strikethrough) in an embedded editor

Under The Hood

Architecture - The package is a thin, well-factored adapter over the Lezer Markdown parser. markdown.ts configures the base Lezer parser with CodeMirror NodeProps for folding, heading levels, indentation, and language data, then wraps it in a Language via mkLang, exporting commonmarkLanguage and an extended GFM+subscript/superscript/emoji markdownLanguage. index.ts exposes the public markdown() factory that assembles a LanguageSupport, pulling in HTML tag handling, parseCode for nested fenced-code parsing through getCodeParser, an optional keymap, HTML-tag autocompletion, and the pasteURLAsLink DOM handler; commands.ts implements the list/blockquote continuation and deletion commands.

Tech Stack - Written in TypeScript targeting an ES module (type: module, dual import/require exports) with sideEffects: false for tree-shaking. It depends on the CodeMirror 6 core (@codemirror/state, @codemirror/view, @codemirror/language, @codemirror/autocomplete), @codemirror/lang-html for embedded HTML, and @lezer/markdown/@lezer/common for parsing. Build and test tooling comes from @codemirror/buildhelper (cm-buildhelper, cm-runtests).

Code Quality - The code is idiomatic and tightly scoped across four small source files, using triple-slash doc comments on the public API that double as generated README reference docs. A test/test-commands.ts suite exercises the Markdown editing commands. Naming is consistent with the wider CodeMirror ecosystem, types are precise, and edge cases (non-plain-text nodes, tight vs. non-tight lists, code/comment regions) are handled explicitly.

API Design - The developer experience is excellent: a single markdown(config?) call returns a ready extension, and the config object is small but expressive (codeLanguages, defaultCodeLanguage, addKeymap, base, completeHTMLTags, pasteURLAsLink, htmlTagLanguage). Sensible defaults mean zero-config usage works, while advanced needs like nested language highlighting are a one-line addition. The public surface is documented inline and mirrored in the README API reference.

Used by 31 apps in this directory

TypeScript
95%
Apache 2.0

AionUi

AI Agents · Productivity

32,102

Free, open-source Cowork desktop app that unifies Claude Code, Codex, Gemini CLI, and 20+ AI agents into a single platform with multi-agent teams, 24/7 cron automation, and zero-config built-in agent.

View details
88
Repo Health
76
Technical
66
Dependency
Built with
TypeScript95%
Updated today
Go
60%
Apache 2.0

Apache Answer

Community

15,652

Open-source Q&A platform for communities, help centers, and knowledge bases with AI assistant and plugin extensibility

View details
85
Repo Health
78
Technical
69
Dependency
Built with
Go60%
TypeScript36%
Updated 2 days ago
TypeScript
99%
Other

byterover-cli

AI Agents · AI Code Assistants

4,941

A portable memory layer for AI coding agents — curate structured project knowledge into a version-controlled context tree that syncs across tools, machines, and teammates.

View details
77
Repo Health
83
Technical
71
Dependency
Built with
TypeScript99%
Updated 1 months ago
Java
34%
Apache 2.0

Enso

Analytics · Data Engineering · Low Code Platforms

7,437

A visual and textual programming platform for data prep and analysis where the node graph and the underlying Enso code are always perfectly in sync, built by an Alteryx co-founder on a GraalVM engine.

View details
70
Repo Health
90
Technical
62
Dependency
Built with
Java34%
TypeScript27%
Scala26%
Updated 1 weeks ago
TypeScript
72%
Other

Epicenter

Knowledge Management · Note Taking · Developer Tools

4,761

A local-first monorepo led by Whispering, an open-source speech-to-text app, built on an MIT toolkit that turns your data into plain Markdown and SQLite files you own instead of a database you rent.

View details
88
Repo Health
90
Technical
68
Dependency
Built with
TypeScript72%
Svelte15%
Updated today
TypeScript
62%
Other

Flowise

Developer Tools · Automation · No Code Platforms

55,379

Drag-and-drop visual builder for AI agents, RAG pipelines, and multi-agent systems—deploy anywhere in minutes.

View details
91
Repo Health
77
Technical
64
Dependency
Built with
TypeScript62%
JavaScript27%
Updated 6 days ago
JavaScript
51%
MIT

Ghost

CMS · Blogging

54,795

Open source headless Node.js CMS for professional publishing, paid memberships, and newsletters with a fully owned audience.

View details
96
Repo Health
85
Technical
69
Dependency
Built with
JavaScript51%
TypeScript43%
Updated today
Rust
69%
Other

GitButler

Developer Tools · Devops · AI Development

21,531

Git, but better — a modern version control client with stacked branches, parallel workflows, unlimited undo, and first-class support for AI-powered development.

View details
89
Repo Health
84
Technical
68
Dependency
Built with
Rust69%
TypeScript18%
Svelte12%
Updated today
Go
83%
MIT

Gitea

Devops · Developer Tools · Project Management

57,487

Self-hosted DevOps in a single Go binary — Git hosting, GitHub Actions-compatible CI/CD, and 30+ package registries without any SaaS dependency.

View details
93
Repo Health
79
Technical
65
Dependency
Built with
Go83%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search