(content: string)
| 67 | }; |
| 68 | |
| 69 | const extractMentions = (content: string) => { |
| 70 | const regex = /@<a([^>]*)href="@(\S+)"([^>]*)>((?:.(?!\<\/a\>))*.)<\/a>/g; |
| 71 | |
| 72 | const replacer = (substring: string, ...args: any[]) => { |
| 73 | const [p1, p2, p3, p4] = args; |
| 74 | return `<a target='_blank' rel='noopener noreferrer' href="https://hashnode.com/@${p2}">${p4}</a>`; |
| 75 | }; |
| 76 | return content.replace(regex, replacer); |
| 77 | }; |
| 78 | |
| 79 | const getSanitizedHTML = (content: string) => { |
| 80 | return sanitizeHtml(content, sanitizeHtmlOptions); |
nothing calls this directly
no outgoing calls
no test coverage detected