MCPcopy Index your code
hub / github.com/basecamp/trix / isInsignificantTextNode

Method isInsignificantTextNode

src/trix/models/html_parser.js:392–399  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

390 }
391
392 isInsignificantTextNode(node) {
393 if (node?.nodeType !== Node.TEXT_NODE) return
394 if (!stringIsAllBreakableWhitespace(node.data)) return
395 const { parentNode, previousSibling, nextSibling } = node
396 if (nodeEndsWithNonWhitespace(parentNode.previousSibling) && !this.isBlockElement(parentNode.previousSibling)) return
397 if (elementCanDisplayPreformattedText(parentNode)) return
398 return !previousSibling || this.isBlockElement(previousSibling) || !nextSibling || this.isBlockElement(nextSibling)
399 }
400
401 isExtraBR(element) {
402 return tagName(element) === "br" && this.isBlockElement(element.parentNode) && element.parentNode.lastChild === element

Callers 2

processNodeMethod · 0.95
appendBlockForElementMethod · 0.95

Calls 4

isBlockElementMethod · 0.95

Tested by

no test coverage detected