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

Function escapeMarkdown

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

Source from the content-addressed store, hash-verified

156 * @returns The escaped text safe for use in markdown
157 */
158export const escapeMarkdown = (text: string): string => {
159 return text.replace(/[\\`*_{}[\]()#+!|]/g, '\\$&');
160};
161
162/**
163 * Truncates text by max length while preserving whole words when possible.

Callers 9

formatTagFunction · 0.90
handlerFunction · 0.90
formatSourceFunction · 0.90
formatSquadFunction · 0.90
handlerFunction · 0.90
buildBylineFunction · 0.90
buildCommunityTakeFunction · 0.90
buildCommentsFunction · 0.90
buildSimilarPostsFunction · 0.90

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected