(inputHtml)
| 78 | * @returns {string} Cleaned HTML string |
| 79 | */ |
| 80 | export const cleanify = (inputHtml) => { |
| 81 | const doc = new DOMParser().parseFromString(inputHtml, 'text/html') |
| 82 | const html = doc.documentElement.innerHTML |
| 83 | return pipe( |
| 84 | input => sanitize(input, getSanitizeHtmlOptions()), |
| 85 | input => stripMultiLinebreaks(input), |
| 86 | input => stripMultispaces(input) |
| 87 | )(html) |
| 88 | } |
| 89 | |
| 90 | /** |
| 91 | * Count the number of img tags in HTML content. |
no test coverage detected
searching dependent graphs…