MCPcopy Create free account
hub / github.com/block/buzz / createRemarkPrefixPlugin

Function createRemarkPrefixPlugin

desktop/src/shared/lib/createRemarkPrefixPlugin.ts:22–32  ·  view source on GitHub ↗
(
  pattern: RegExp,
  buildNode: NodeBuilder,
)

Source from the content-addressed store, hash-verified

20 * nodes, and replaces each match with a node produced by `buildNode`.
21 */
22export function createRemarkPrefixPlugin(
23 pattern: RegExp,
24 buildNode: NodeBuilder,
25) {
26 return (
27 // biome-ignore lint/suspicious/noExplicitAny: remark tree types are not available
28 tree: any,
29 ) => {
30 walkChildren(tree, pattern, buildNode);
31 };
32}
33
34// biome-ignore lint/suspicious/noExplicitAny: remark tree types are not available
35function walkChildren(node: any, pattern: RegExp, buildNode: NodeBuilder) {

Callers 3

remarkMessageLinksFunction · 0.90
remarkMentionsFunction · 0.90
remarkChannelLinksFunction · 0.90

Calls 1

walkChildrenFunction · 0.70

Tested by

no test coverage detected