Files
hudozka/src/lib/text.ts
T
2022-09-06 14:52:56 +03:00

20 lines
376 B
TypeScript

import MarkdownIt from "markdown-it"
import Typograf from "typograf"
const tp = new Typograf({ locale: ["ru"] })
const md = new MarkdownIt({
html: true,
})
export type MarkdownProps = {
data: string
}
export function markdownToHtml(data: string): string {
return md.render(data)
}
export function typograf(data: string): string {
return tp.execute(data)
}