(html: string)
| 2 | import {htmlTextMapper} from '../html-text-mapper'; |
| 3 | |
| 4 | function htmlToText(html: string) { |
| 5 | const div = document.createElement('div'); |
| 6 | div.innerHTML = html; |
| 7 | // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition |
| 8 | return div.textContent ?? ''; |
| 9 | } |
| 10 | |
| 11 | test('basic functionality', () => { |
| 12 | const html = 'foo<span>bar</span>baz'; |