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

Function execPreParser

src/utils/transformation.js:104–108  ·  view source on GitHub ↗
(html, links)

Source from the content-addressed store, hash-verified

102 * @returns {string} Transformed HTML string
103 */
104export const execPreParser = (html, links) => {
105 const doc = new DOMParser().parseFromString(html, 'text/html')
106 findTransformations(links).map(tfm => tfm.pre).filter(fn => isFunction(fn)).forEach(fn => fn(doc))
107 return Array.from(doc.childNodes).map(it => it.outerHTML).join('')
108}
109
110/**
111 * Run post-extraction transformations on extracted article content.

Callers 2

parseFromHtml.jsFile · 0.90

Calls 1

findTransformationsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…