Skip to content
/ rmark Public template

RMark is a simple regex-based toy Markdown parser written in TypeScript.

Notifications You must be signed in to change notification settings

tlylt/rmark

Repository files navigation

RMark

RMark is a simple regex-based toy Markdown parser written in TypeScript.

CI

npm

Usage

Install the package:

npm install @tlylt/rmark

Import the package and use it:

import { RMark } from '@tlylt/rmark';

const rmark = new RMark();
const html = rmark.render('# Hello, world!');

Add more rules to the parser:

import { RMark, Rule, Pattern } from '@tlylt/rmark';

const rmark = new RMark();
rmark.addRule(
    new Rule('horizontal', [
    new Pattern(/^(-{3})/gm, '<hr />'),
    new Pattern(/^(_{3})/gm, '<hr />'),
    ])
);
const html = rmark.render('---');

About

RMark is a simple regex-based toy Markdown parser written in TypeScript.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published