remark-breaks

A remark plugin that turns soft line breaks into hard breaks without needing spaces or escapes.

Library
npm
v4.0.0
155 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
37 /100 Needs Attention
Development Activity 0
Maintenance 20
Community 48
Maturity 60
Momentum 20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
76 /100 Good
Architecture 70
Code Quality 85
Innovation 55
Learning Curve 95

remark-breaks is a small unified/remark plugin that converts every soft line ending in a Markdown paragraph into a hard break (<br>), matching how platforms like GitHub render comments, issues, and PRs even though it isn’t strictly compliant Markdown.

Normally Markdown requires trailing spaces or a backslash escape to force a line break; this plugin removes that requirement so user-authored content (chat messages, comments, freeform notes) renders visually the same way it was typed, without asking authors to learn Markdown’s hard-break syntax.

What You Get

  • A one-line unified().use(remarkBreaks) integration that requires no configuration or options
  • Enters converted to <br> in the rendered HTML output, matching GitHub-style comment/issue rendering
  • Full TypeScript types shipped via @types/mdast and a generated index.d.ts
  • ESM-only, tree-shakeable module with no runtime side effects (sideEffects: false)
  • 100% test coverage enforced via c8 --100 in the test script

Common Use Cases

  • Rendering user-submitted comments, chat messages, or notes where authors don’t know Markdown’s hard-break syntax
  • Building a GitHub-comment-style preview pane that needs to match GitHub’s own line-break rendering behavior
  • Any remark/unified-based content pipeline where preserving visual line structure matters more than strict CommonMark compliance
  • Static site generators or CMSs that ingest freeform, loosely-formatted Markdown from non-technical authors

Under The Hood

Architecture The entire implementation is a ~15-line function in lib/index.js that returns a unified Transform: given the parsed mdast Root tree, it delegates the actual node rewriting to the separate mdast-util-newline-to-break package, which finds soft breaks and reclassifies them as hard break nodes. This plugin exists purely as unified/remark glue around that utility — it owns no parsing or serialization logic itself, which is idiomatic for the unified ecosystem’s compose-many-small-plugins design.

Tech Stack Pure ESM JavaScript (type: module) with TypeScript types generated via tsc --build rather than hand-written, plus @types/mdast for the tree type definitions. Depends on unified (^11) and mdast-util-newline-to-break (^2) as its only runtime dependencies. Uses xo (ESLint preset) and prettier for style, and remark-cli/remark-preset-wooorm to lint its own documentation.

Code Quality test.js runs fixture-based tests (input Markdown → expected HTML) covering variations like zero/one/two/three trailing spaces and \r line endings, run through a real remark-parse → remarkBreaks → remark-rehype → rehype-stringify pipeline rather than mocks. Coverage is enforced at 100% via c8 --100, and the package also runs type-coverage to guarantee full type coverage on every build — a high quality bar for a project this small.

API Design The API is a single default export with zero configuration options or arguments: unified().use(remarkBreaks) is the entire integration surface. This no-config design is the norm for narrowly-scoped unified plugins and keeps the learning curve essentially zero — the tradeoff is no per-use customization if a consumer wanted, e.g., a different break tag.

Used by 22 apps in this directory

Rust
56%
Other

Jan

AI Assistants

45,052

Run LLMs 100% locally with full privacy, or connect to cloud AI — your machine, your data, your control.

View details
90
Repo Health
81
Technical
65
Dependency
Built with
Rust 56%
TypeScript 40%
Updated 6 days ago
TypeScript
98%
AGPL 3.0

Karakeep

Bookmarks Archiving

29,926

Self-hosted bookmark manager that captures links, notes, images, and PDFs with AI tagging, full-text search, and automatic archiving.

View details
88
Repo Health
76
Technical
66
Dependency
Built with
TypeScript 98%
Updated 1 weeks ago
TypeScript
78%
LGPL 3.0

Latitude

AI Agents · Monitoring

4,733

Open-source AI agent monitoring that catches what will break next before your users do.

View details
87
Repo Health
88
Technical
67
Dependency
Built with
TypeScript 78%
Python 11%
Rust 11%
Updated 1 weeks ago
Go
53%
MIT

memos

Note Taking

64,031

Open-source, self-hosted note-taking built for quick capture — Markdown-native, lightweight, and fully yours.

View details
91
Repo Health
78
Technical
65
Dependency
Built with
Go 53%
TypeScript 46%
Updated 6 days ago
Go
56%
Other

Multica

AI Assistants · AI Development

53,682

Turn coding agents into real teammates — assign issues, track progress, and compound reusable skills across a vendor-neutral, self-hosted platform.

View details
87
Repo Health
83
Technical
67
Dependency
Built with
Go 56%
TypeScript 38%
Updated 6 days ago
TypeScript
92%
Other

OpenHands

AI Code Assistants · AI Development

91,695

The self-hosted developer control center for running AI coding agents — locally, in Docker, on VMs, or across cloud backends — with automation workflows for GitHub, Slack, and more.

View details
91
Repo Health
82
Technical
67
Dependency
Built with
TypeScript 92%
Updated 1 weeks ago
TypeScript
85%
MIT

openwork

AI Assistants · Automation

24,237

OpenWork is a free, open-source desktop app for running AI agent workflows on your own files with 50+ LLMs, extensible skills, and MCP server support — the open-source alternative to Claude Cowork and Codex.

View details
87
Repo Health
89
Technical
67
Dependency
Built with
TypeScript 85%
Updated 6 days ago
TypeScript
96%
MIT

Orca

AI Agents · AI Code Assistants

104,104

An open-source Agent Development Environment that orchestrates fleets of parallel AI coding agents — Claude Code, Codex, Gemini and more — each running in its own isolated git worktree.

View details
84
Repo Health
85
Technical
74
Dependency
Built with
TypeScript 96%
Updated 6 days ago
Python
55%
Other

PostHog

Ab Testing Experimentation · Analytics · Developer Tools

40,397

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
65
Dependency
Built with
Python 55%
TypeScript 36%
Updated 6 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