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 →
38/100Needs Attention
Development Activity8
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 30 apps in this directory

TypeScript
95%
Apache 2.0

AionUi

AI Agents · Productivity

32,622

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
87
Repo Health
76
Technical
66
Dependency
Built with
TypeScript95%
Updated 5 days ago
Go
60%
Apache 2.0

Apache Answer

Community

15,665

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

View details
83
Repo Health
78
Technical
68
Dependency
Built with
Go60%
TypeScript36%
Updated 1 weeks ago
TypeScript
99%
Other

byterover-cli

AI Agents · AI Code Assistants

4,956

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
52
Repo Health
83
Technical
70
Dependency
Built with
TypeScript99%
Updated 2 months ago
TypeScript
65%
Other

Epicenter

Knowledge Management · Note Taking · Developer Tools

4,790

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
TypeScript65%
Svelte13%
HTML12%
Updated yesterday
TypeScript
62%
Other

Flowise

Developer Tools · Automation · No Code Platforms

55,427

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

View details
86
Repo Health
77
Technical
63
Dependency
Built with
TypeScript62%
JavaScript27%
Updated 3 weeks ago
JavaScript
47%
MIT

Ghost

CMS · Blogging

55,191

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
67
Dependency
Built with
JavaScript47%
TypeScript47%
Updated yesterday
Rust
67%
Other

GitButler

Developer Tools · Devops · AI Development

21,624

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
67
Dependency
Built with
Rust67%
TypeScript20%
Svelte11%
Updated yesterday
Go
83%
MIT

Gitea

Devops · Developer Tools · Project Management

57,850

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
64
Dependency
Built with
Go83%
Updated today
Go
62%
Apache 2.0

Harness Open Source

Developer Tools · Devops · Code Editors

38,251

A unified open source DevOps platform combining Git hosting, CI/CD pipelines, cloud development environments, and artifact registries in a single self-hosted system.

View details
89
Repo Health
79
Technical
64
Dependency
Built with
Go62%
TypeScript34%
Updated 3 days ago

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