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

Function escapeMarkdown

packages/shared/src/lib/strings.ts:151–153  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

149 * @returns The escaped text safe for use in markdown
150 */
151export const escapeMarkdown = (text: string): string => {
152 return text.replace(/[\\`*_{}[\]()#+!|]/g, '\\$&');
153};
154
155/**
156 * Truncates text by max length while preserving whole words when possible.

Callers 5

formatTagFunction · 0.90
handlerFunction · 0.90
formatSourceFunction · 0.90
formatSquadFunction · 0.90
handlerFunction · 0.90

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected