feat: count characters consistently

This commit is contained in:
Sam 2023-04-02 22:50:22 +02:00
parent 80ca1cae00
commit 8433a1523a
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
9 changed files with 54 additions and 20 deletions

View file

@ -6,6 +6,8 @@ const md = new MarkdownIt({
breaks: true,
}).disable(["heading", "link", "table"]);
export default function renderMarkdown(src: string | null) {
export function renderMarkdown(src: string | null) {
return src ? sanitize(md.render(src)) : null;
}
export const charCount = (str: string) => [...str].length;