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

Function trimExcludingNbsp

javascript/atoms/typescript/get-text.ts:77–79  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

75// Trims all whitespace except NBSP (\xa0) from both ends of a string.
76// (dom.js line 999: bot.dom.trimExcludingNonBreakingSpaceCharacters_)
77function trimExcludingNbsp(str: string): string {
78 return str.replace(/^[^\S\xa0]+|[^\S\xa0]+$/g, '')
79}
80
81// goog.string.isEmptyOrWhitespace treats \xa0 as whitespace for this check.
82// (referenced at dom.js lines 1079, 1115)

Callers 1

concatenateCleanedLinesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected