0.1.4 • Published 3 months ago

sublinks-markdown v0.1.4

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

About

Sublinks markdown is a package that can be imported into your frontend and then used to add markdown support through one function call. All of the markdown rules used in the standard sublinks frontend are supported meaning your users will see the same things as users using the standard frontend without you needing to implement every single rule yourself.

Install

This package is ESM only. To install with npm use:

npm i sublinks-markdown

Usage

To convert text from markdown syntax into html use the mdToHtml function

import { mdToHtml } from "sublinks-markdown";

const html = await mdToHtml("## Hello World", "example.com")

The first argument is the markdown you want converted and the second is the instance of the user currently interacting with the frontend (so things such as relative links populate properly).

Features