(html: string)
| 352 | * entity decoding (also used elsewhere in the repo for the same purpose). |
| 353 | */ |
| 354 | export function htmlToPlainText(html: string): string { |
| 355 | return convert(html, { |
| 356 | wordwrap: false, |
| 357 | selectors: [ |
| 358 | { selector: 'a', options: { hideLinkHrefIfSameAsText: true, noAnchorUrl: true } }, |
| 359 | { selector: 'img', format: 'skip' }, |
| 360 | { selector: 'script', format: 'skip' }, |
| 361 | { selector: 'style', format: 'skip' }, |
| 362 | ], |
| 363 | }) |
| 364 | } |
| 365 | |
| 366 | /** |
| 367 | * Produce the plain-text and HTML representations of a body so we can emit a |
no test coverage detected