(text: string)
| 265 | } |
| 266 | |
| 267 | function preserveSoftBreaks(text: string): string { |
| 268 | return text |
| 269 | .split(/(```[\s\S]*?```)/g) |
| 270 | .map((segment, i) => (i % 2 === 0 ? segment.replace(/([^\n])\n(?=[^\n])/g, '$1 \n') : segment)) |
| 271 | .join('') |
| 272 | } |
| 273 | |
| 274 | function stripUnsafeUrls(html: string): string { |
| 275 | return html.replace(/href\s*=\s*(['"])(?:javascript|vbscript|data):.*?\1/gi, 'href="#"') |
no test coverage detected