Tiny markdown-it plugin, with typograf integration.
Check demo.
npm install markdown-it-typograf
import markdownit from "markdown-it";
import markdownitTypograf from "markdown-it-typograf";
const md = markdownit().use(markdownitTypograf, {
// ...options
});
console.log(md.render('"Привет"')); // <p>«Привет»</p>\n
Option | Default | Description |
---|---|---|
typografOptions |
{ locale: 'ru' } |
Options passed to typograf. |
typografSetup |
undefined |
Function to customize typograf programmatically. |
const md = markdownit().use(markdownitTypograf, {
typografOptions: {
locale: "ru",
disableRule: "*",
},
typografSetup(tp) {
tp.enableRule("common/number/mathSigns");
},
});
console.log(md.render("0 != 1")); // <p>0 ≠ 1</p>\n
bun install
bun run dev