MCPcopy
hub / github.com/extractus/article-extractor / cleanify

Function cleanify

src/utils/html.js:80–88  ·  view source on GitHub ↗
(inputHtml)

Source from the content-addressed store, hash-verified

78 * @returns {string} Cleaned HTML string
79 */
80export 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.

Callers 2

parseFromHtml.jsFile · 0.90
html.test.jsFile · 0.90

Calls 3

getSanitizeHtmlOptionsFunction · 0.90
stripMultiLinebreaksFunction · 0.85
stripMultispacesFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…