You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@types/markdown-it

Package Overview
Dependencies
2
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/markdown-it

TypeScript definitions for markdown-it


Version published
Maintainers
1
Created

Package description

What is @types/markdown-it?

The @types/markdown-it package provides TypeScript type definitions for the markdown-it library, a Markdown parser done right. It enables developers to use markdown-it in TypeScript projects with type checking, enhancing development experience by providing autocompletion and error checking based on the types of the markdown-it API.

What are @types/markdown-it's main functionalities?

Basic Parsing

This feature allows for the conversion of Markdown text into HTML. The code sample demonstrates how to create an instance of MarkdownIt and use it to render a simple Markdown string into HTML.

import MarkdownIt from 'markdown-it';
const md = new MarkdownIt();
const result = md.render('# markdown-it rulezz!');

Custom Renderer

This feature enables customization of the HTML output for specific Markdown elements. In the code sample, the rendering rules for strong (bold) text are modified to use '<b>' tags instead of the default '<strong>'.

import MarkdownIt from 'markdown-it';
const md = new MarkdownIt();
md.renderer.rules.strong_open = () => '<b>';
md.renderer.rules.strong_close = () => '</b>';
const result = md.render('**text**');

Plugin Usage

This feature demonstrates how to extend markdown-it with plugins. The code sample shows the use of the markdown-it-emoji plugin to render emojis within the Markdown text.

import MarkdownIt from 'markdown-it';
import emojiPlugin from 'markdown-it-emoji';
const md = new MarkdownIt();
md.use(emojiPlugin);
const result = md.render(':smile:');

Other packages similar to @types/markdown-it

Readme

Source

Installation

npm install --save @types/markdown-it

Summary

This package contains type definitions for markdown-it (https://github.com/markdown-it/markdown-it).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/markdown-it.

Additional Details

Credits

These definitions were written by York Yao, Robert Coie, duduluu, and Piotr Błażejewicz.

FAQs

Package last updated on 01 May 2024

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc