{"id":16194,"library":"remarkable","title":"Remarkable Markdown Parser","description":"Remarkable is a fast, extensible Markdown parser for JavaScript, offering 100% CommonMark specification support, alongside syntax extensions and typographer features. Currently at version 2.0.1, the library provides a robust solution for converting Markdown strings to HTML. Its key differentiators include high performance, a highly configurable parsing engine that allows adding or replacing syntax rules, and a vibrant community plugin ecosystem available via npm. Version 2.0.0 introduced significant changes, including a migration to ES module source code, rollup-based bundling for UMD, CJS, and ESM formats, and a shift to named exports for its public API. The project maintains an active development status, with updates focusing on stability and modern JavaScript practices.","status":"active","version":"2.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/jonschlinkert/remarkable","tags":["javascript","commonmark","markdown","md","parse","parser","process","remarkable","render"],"install":[{"cmd":"npm install remarkable","lang":"bash","label":"npm"},{"cmd":"yarn add remarkable","lang":"bash","label":"yarn"},{"cmd":"pnpm add remarkable","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Since v2.0.0, Remarkable's public API uses named exports for better ESM/CJS interop. The default export was removed.","wrong":"import Remarkable from 'remarkable';","symbol":"Remarkable","correct":"import { Remarkable } from 'remarkable';"},{"note":"For CommonJS environments, ensure to destructure the named export as the default export was removed in v2.0.0.","wrong":"const Remarkable = require('remarkable');","symbol":"Remarkable (CommonJS)","correct":"const { Remarkable } = require('remarkable');"},{"note":"Presets like 'commonmark' or 'full' can be passed as a string argument to the Remarkable constructor to quickly apply common configurations.","symbol":"RemarkablePresets","correct":"const md = new Remarkable('commonmark');"}],"quickstart":{"code":"import { Remarkable } from 'remarkable';\n\n// Initialize Remarkable with default settings (similar to GFM, but HTML disabled)\nconst md = new Remarkable();\n\n// Render a basic Markdown string to HTML\nconst markdownString = '# Hello, Remarkable!\\n\\nThis is a *simple* paragraph.';\nconst htmlOutput = md.render(markdownString);\n\nconsole.log('--- Default Rendering ---');\nconsole.log(htmlOutput);\n// Expected output: <h1>Hello, Remarkable!</h1><p>This is a <em>simple</em> paragraph.</p>\n\n// Demonstrate a common preset: 'commonmark'\nconst mdCommonMark = new Remarkable('commonmark');\nconst commonMarkOutput = mdCommonMark.render('1. Ordered list item\\n\\n- Unordered list item');\n\nconsole.log('\\n--- CommonMark Preset Rendering ---');\nconsole.log(commonMarkOutput);\n\n// Demonstrate setting options via constructor\nconst mdWithOptions = new Remarkable({\n  html: true,         // Enable HTML tags in source\n  breaks: true,       // Convert '\\n' in paragraphs into <br>\n  typographer: true   // Enable smart quotes and other typographic improvements\n});\n\nconst complexMarkdown = `\n# Markdown with Options\n<p>This is an HTML paragraph.</p>\nLine one.\nLine two.\n\n\"Smart quotes\" should be enabled.\n`;\nconst complexHtmlOutput = mdWithOptions.render(complexMarkdown);\n\nconsole.log('\\n--- Rendering with Custom Options ---');\nconsole.log(complexHtmlOutput);","lang":"typescript","description":"Demonstrates basic usage of the Remarkable parser, including default rendering, applying the 'commonmark' preset, and configuring options via the constructor to enable features like HTML tags, line breaks, and typographer rules."},"warnings":[{"fix":"Change `import Remarkable from 'remarkable'` to `import { Remarkable } from 'remarkable'` for ESM, or `const { Remarkable } = require('remarkable');` for CommonJS.","message":"The default import `import Remarkable from 'remarkable'` was removed in v2.0.0. The library now exclusively uses named exports for its public API.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Rely solely on the public API of the `remarkable` package by importing directly from `remarkable`. Avoid accessing internal paths.","message":"The internal `lib` directory is no longer published or considered part of the public API since v2.0.0. Direct imports from `remarkable/lib/...` are unsupported and will break.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Migrate package management to npm or Yarn. Install Remarkable using `npm install remarkable` or `yarn add remarkable`.","message":"Bower support was officially removed in v2.0.0 due to its deprecation in modern web development workflows.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Instead of `md.set({ /* options */ })`, create a new instance: `const mdConfigured = new Remarkable({ /* options */ });`.","message":"Modifying a `Remarkable` instance on the fly using `md.set()` can negatively impact performance. For optimal speed, it is recommended to create separate instances for different configurations.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-21T00:00:00.000Z","next_check":"2026-07-20T00:00:00.000Z","problems":[{"fix":"For ESM, use `import { Remarkable } from 'remarkable';`. For CommonJS, use `const { Remarkable } = require('remarkable');`.","cause":"Attempting to instantiate `Remarkable` using a default import or incorrect CommonJS require after the v2.0.0 breaking change to named exports.","error":"TypeError: Remarkable is not a constructor"},{"fix":"Only import directly from the main `remarkable` package (`import { Remarkable } from 'remarkable';`). Internal modules are not part of the public API.","cause":"Attempting to import from the internal `lib` directory, which is no longer published or supported since v2.0.0.","error":"ERR_MODULE_NOT_FOUND: Cannot find module 'remarkable/lib/some-internal-module'"}],"ecosystem":"npm"}