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

4 lines
196 B
TypeScript
Raw Normal View History

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