0.0.9 • Published 11 months ago

@discord-user-card/markdown v0.0.9

Weekly downloads
-
License
-
Repository
-
Last release
11 months ago

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";
0.0.9

11 months ago

0.0.8

12 months ago

0.0.7

12 months ago

0.0.6

12 months ago

0.0.5

12 months ago

0.0.4

12 months ago

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago