MCPcopy Create free account
hub / github.com/bytebase/bytebase / escapeMarkdown

Function escapeMarkdown

frontend/src/utils/string.ts:1–3  ·  view source on GitHub ↗
(md: string)

Source from the content-addressed store, hash-verified

1export const escapeMarkdown = (md: string): string => {
2 return md.replaceAll(/[*_~\-#`[\]()\\]/g, (ch) => `\\${ch}`);
3};
4
5// Matches the Go `strings.TrimSpace` / `unicode.IsSpace` predicate so that
6// the frontend's empty-title decision agrees with the backend.

Callers 1

buildAdviceHoverMessageFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected