verdnatura-chat/app/containers/markdown/formatHyperlink.ts

4 lines
196 B
TypeScript
Raw Normal View History

2022-02-28 18:00:47 +00:00
// Ex: '[ ](https://open.rocket.chat/group/test?msg=abcdef) Test'
// Return: 'Test'
export const formatHyperlink = (text: string): string => text.replace(/^\[([\s]*)\]\(([^)]*)\)\s/, '').trim();