Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

remarkable

Package Overview
Dependencies
Maintainers
8
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remarkable

Markdown parser, done right. 100% Commonmark support, extensions, syntax plugins, high speed - all in one.

  • 1.7.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
822K
increased by9.14%
Maintainers
8
Weekly downloads
 
Created

What is remarkable?

The 'remarkable' npm package is a powerful markdown parser that allows you to convert markdown text into HTML. It is highly configurable and supports a wide range of markdown features, making it suitable for various use cases such as rendering markdown content on websites, converting markdown files to HTML, and more.

What are remarkable's main functionalities?

Basic Markdown to HTML Conversion

This feature allows you to convert basic markdown text into HTML. The code sample demonstrates how to convert a markdown heading into HTML.

const Remarkable = require('remarkable');
const md = new Remarkable();
const html = md.render('# Hello, world!');
console.log(html);

Custom Syntax Highlighting

This feature allows you to add custom syntax highlighting to code blocks in your markdown. The code sample demonstrates how to use the 'highlight.js' library to highlight JavaScript code within a markdown code block.

const Remarkable = require('remarkable');
const hljs = require('highlight.js');
const md = new Remarkable({
  highlight: function (str, lang) {
    if (lang && hljs.getLanguage(lang)) {
      try {
        return hljs.highlight(lang, str).value;
      } catch (__) {}
    }
    return ''; // use external default escaping
  }
});
const html = md.render('```js\nconsole.log("Hello, world!");\n```');
console.log(html);

Customizing Markdown Rendering

This feature allows you to customize various aspects of markdown rendering. The code sample demonstrates how to enable HTML tags, convert newlines to <br> tags, and automatically convert URLs to links.

const Remarkable = require('remarkable');
const md = new Remarkable({
  html: true, // Enable HTML tags in source
  xhtmlOut: true, // Use '/' to close single tags (<br />)
  breaks: true, // Convert '\n' in paragraphs into <br>
  langPrefix: 'language-', // CSS language prefix for fenced blocks
  linkify: true, // Autoconvert URL-like text to links
  typographer: true // Enable smartypants and other sweet transforms
});
const html = md.render('# Hello, world!\nThis is a [link](http://example.com).');
console.log(html);

Other packages similar to remarkable

Keywords

FAQs

Package last updated on 29 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc