(text: string)
| 89 | } |
| 90 | |
| 91 | export function formatSlackMessage(text: string): string { |
| 92 | const unwrapped = unwrapMarkdownSourceBlocks(text); |
| 93 | const placeholders: string[] = []; |
| 94 | const withFenced = protect( |
| 95 | unwrapped, |
| 96 | FENCED_CODE_BLOCK_RE, |
| 97 | placeholders, |
| 98 | (block: string) => block, |
| 99 | ); |
| 100 | const withInline = protect( |
| 101 | withFenced, |
| 102 | INLINE_CODE_RE, |
| 103 | placeholders, |
| 104 | (_match: string, code: string) => `\`${code}\``, |
| 105 | ); |
| 106 | |
| 107 | return restore(formatSlackInline(withInline), placeholders); |
| 108 | } |
| 109 | |
| 110 | export function formatTelegramMessage(text: string): string { |
| 111 | const unwrapped = unwrapMarkdownSourceBlocks(text); |
no test coverage detected