(text: string)
| 149 | * @returns The escaped text safe for use in markdown |
| 150 | */ |
| 151 | export const escapeMarkdown = (text: string): string => { |
| 152 | return text.replace(/[\\`*_{}[\]()#+!|]/g, '\\$&'); |
| 153 | }; |
| 154 | |
| 155 | /** |
| 156 | * Truncates text by max length while preserving whole words when possible. |
no test coverage detected