/
githubmirror
/
tldraw
Обзор
Документация
Войти
/
githubmirror
/
tldraw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
apps/docs/utils/replace-md-links.ts
11 строк
317 B
alex
consistent function style (#4468)
09 сен 2024, 16:38
Не верифицирован
09 сен 2024, 16:38
4752713
Код
Авторство
О чём код?
export function replaceMarkdownLinks(text: string) { const links = text.match(/\[.*?\)/g) if (links !== null && links.length > 0) { for (const link of links) { const caption = link.match(/\[(.*?)\]/)![1] // const url = link.match(/\((.*?)\)/)![1] text = text.replace(link, caption) } } return text }