0.0.9 • Published 12 months ago

@discord-user-card/markdown v0.0.9

Weekly downloads
-
License
-
Repository
-
Last release
12 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

12 months ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago