Convert Newlines to Hard Breaks in mdast
JSON →mdast-util-newline-to-break is a utility for the unified ecosystem that transforms soft line endings (simple newlines) in an mdast syntax tree into hard break (<br>) nodes. This is particularly useful for rendering user-authored content where line breaks should visually translate to actual line breaks, mimicking GitHub's behavior in comments or issues. The current stable version is 2.0.0. As part of the unified collective, it maintains compatibility with actively supported Node.js versions, with major releases typically coinciding with Node.js LTS updates. Unlike standard Markdown, which requires two trailing spaces or a backslash for a hard break, this utility provides a more direct conversion. It is often used internally by higher-level plugins like `remark-breaks`.
Traffic · last 30 days ↑25% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇺🇦 Ukraine · 🇬🇧 United Kingdom · 🇩🇪 Germany