MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / concatenateCleanedLines

Function concatenateCleanedLines

javascript/atoms/typescript/get-text.ts:90–95  ·  view source on GitHub ↗
(lines: string[])

Source from the content-addressed store, hash-verified

88// result (excluding NBSP), then converts all remaining NBSP to regular spaces.
89// (dom.js line 1010: bot.dom.concatenateCleanedLines_)
90function concatenateCleanedLines(lines: string[]): string {
91 const trimmedLines = lines.map(trimExcludingNbsp)
92 const joined = trimmedLines.join('\n')
93 const trimmed = trimExcludingNbsp(joined)
94 return trimmed.replace(/\xa0/g, ' ')
95}
96
97// Appends the visible contribution of a text node to the running lines array,
98// applying white-space collapsing rules and text-transform.

Callers 1

getTextFunction · 0.85

Calls 2

trimExcludingNbspFunction · 0.85
mapMethod · 0.45

Tested by

no test coverage detected