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

showdown

Package Overview
Dependencies
Maintainers
3
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

showdown

A Markdown to HTML converter written in Javascript

  • 1.6.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
271K
decreased by-57.75%
Maintainers
3
Weekly downloads
 
Created

What is showdown?

Showdown is a JavaScript Markdown to HTML converter, based on the original works by John Gruber. It allows you to easily convert Markdown text into HTML, making it useful for web applications, documentation, and other text processing tasks.

What are showdown's main functionalities?

Convert Markdown to HTML

This feature allows you to convert Markdown text into HTML. The code sample demonstrates how to create a new Showdown converter instance and use it to convert a Markdown string into HTML.

const showdown = require('showdown');
const converter = new showdown.Converter();
const markdown = '# Hello, Showdown!';
const html = converter.makeHtml(markdown);
console.log(html);

Customize Output

Showdown allows you to customize the output by enabling or disabling various options. The code sample shows how to enable the 'tables' and 'strikethrough' options to enhance the Markdown to HTML conversion.

const showdown = require('showdown');
const converter = new showdown.Converter({ tables: true, strikethrough: true });
const markdown = '~~Strikethrough~~ and a table:

| h1 | h2 |
| --- | --- |
| cell1 | cell2 |';
const html = converter.makeHtml(markdown);
console.log(html);

Extension Support

Showdown supports extensions, allowing you to add custom functionality to the conversion process. The code sample demonstrates how to create a simple extension that converts '@text' into bold HTML text.

const showdown = require('showdown');
showdown.extension('myextension', function() {
  return [{
    type: 'lang',
    regex: /@(	ext)/g,
    replace: '<strong>$1</strong>'
  }];
});
const converter = new showdown.Converter({ extensions: ['myextension'] });
const markdown = 'This is @text.';
const html = converter.makeHtml(markdown);
console.log(html);

Other packages similar to showdown

Keywords

FAQs

Package last updated on 28 Jan 2017

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