markdown-it-typograf
v0.1.3
Published
Typograf integration for markdown-it
Readme
📃 markdown-it-typograf
Tiny markdown-it plugin, with typograf integration.
Check demo.
Setup
npm install markdown-it-typografUsage
import markdownit from "markdown-it";
import markdownitTypograf from "markdown-it-typograf";
const md = markdownit().use(markdownitTypograf, {
// ...options
});
console.log(md.render('"Привет"')); // <p>«Привет»</p>\nOptions
| Option | Default | Description |
| ----------------- | ------------------ | ------------------------------------------------------------------- |
| typografOptions | { locale: 'ru' } | Options passed to typograf. |
| typografSetup | undefined | Function to customize typograf programmatically. |
Example
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>\nDevelopment
bun install
bun run dev