(text: string)
| 47 | } |
| 48 | |
| 49 | function formatSlackInline(text: string): string { |
| 50 | let formatted = text; |
| 51 | |
| 52 | formatted = formatted.replace(LINK_RE, (_, label: string, url: string) => { |
| 53 | return `<${url}|${label}>`; |
| 54 | }); |
| 55 | formatted = formatted.replace( |
| 56 | /^(#{1,6})[ \t]+(.+)$/gm, |
| 57 | (_, __: string, content: string) => `*${content.trim()}*`, |
| 58 | ); |
| 59 | formatted = formatted.replace(/\*\*([^*\n]+)\*\*/g, "*$1*"); |
| 60 | formatted = formatted.replace(/__([^_\n]+)__/g, "*$1*"); |
| 61 | formatted = formatted.replace(/^(?:-|\*) /gm, "• "); |
| 62 | |
| 63 | return formatted; |
| 64 | } |
| 65 | |
| 66 | function formatTelegramInline(text: string): string { |
| 67 | let formatted = escapeHtml(text); |
no outgoing calls
no test coverage detected