Socket
Book a DemoInstallSign in
Socket

@discord-user-card/markdown

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@discord-user-card/markdown

A markdown parser for Discord

0.0.9
latest
npmnpm
Version published
Maintainers
1
Created
Source

@Discord-User-Card/Markdown

NPM Version CI Status

A markdown parser for Discord

Usage

import { type SingleASTNode, parseMarkdown, toHTML, rerenderInterval } from "@discord-user-card/markdown";

const markdown = `# Hello, World!\n\nThis is a **test**.||This is a spoiler.||`;

// Parse markdown and get the AST nodes
console.log(parseMarkdown(markdown)); // SingleASTNode[]

// Parse markdown and get the HTML
console.log(toHTML(markdown)); // string (Raw HTML)

// Parse markdown and get the rerender interval (some markdown elements need to be rerendered periodically to work properly)
console.log(rerenderInterval(markdown)); // number | undefined (Interval in milliseconds, undefined if no interval)

You can also import the styles from the package:

// css
import "@discord-user-card/markdown/style.css";
// scss
import "@discord-user-card/markdown/style.scss";

Keywords

discord

FAQs

Package last updated on 08 Aug 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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.