MCPcopy Create free account
hub / github.com/dailydotdev/apps / text

Function text

packages/shared/src/features/briefing/briefBodyBlocks.ts:37–45  ·  view source on GitHub ↗
(node: Element)

Source from the content-addressed store, hash-verified

35/* textContent, not innerText: innerText needs layout, which jsdom has none of,
36 and the collapsed whitespace is what a card wants anyway. */
37const text = (node: Element) => {
38 const clone = node.cloneNode(true) as Element;
39
40 clone
41 .querySelectorAll(BRIEF_SOURCE_LINK_SELECTOR)
42 .forEach((link) => link.remove());
43
44 return (clone.textContent ?? '').replace(/\s+/g, ' ').trim();
45};
46
47/**
48 * The section a heading opens, up to the next heading of any level. Matching is

Callers 1

getBriefSectionFunction · 0.70

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected