/*** EXPORT ------------------------------------------- ***/ export default (input: string): string => { return input .replace(/(\*\*|__)(.*?)\1/g, `$2`) /*** bold ***/ .replace(/(\*|_)(.*?)\1/g, "$2") /*** italic ***/ .replace(/(\~~)(.*?)\1/g, "$2") /*** strikethrough ***/ .replace(/'/g, "’") /*** fancy apostrophe ***/ .replace(/(:nbhyp:)/g, "‑") /*** non‑breaking hyphen ***/ .replace(/(:nbsp:)/g, " ") /*** non‑breaking space ***/ .replace(/(\.\.\.)/g, "…") /*** ellipsis ***/ // .replace(/---/g, "
") .replace(/\[([^\]]+)\]\(([^)]+)\)/g, `$1`); /*** link ***/ // TODO // : check if link is local and if not, add `target="_blank"` }