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

Function stripMultiLinebreaks

src/utils/html.js:38–44  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

36 * @returns {string} Cleaned string
37 */
38const stripMultiLinebreaks = (str) => {
39 return str.replace(/(\r\n|\n|\u2424){2,}/g, '\n').split('\n').map((line) => {
40 return WS_REGEXP.test(line) ? line.trim() : line
41 }).filter((line) => {
42 return line.length > 0
43 }).join('\n')
44}
45
46/**
47 * Replace all-whitespace sequences with a single space.

Callers 1

cleanifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…