Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go
339 B
Raw Blame
/**
 * Escape characters that break Markdown link/image label syntax: [ ] \ ( )
 * Used by image and file-card renderMarkdown to prevent raw filenames from
 * corrupting the `![alt](url)` / `!file[name](url)` output.
 */
export function escapeMarkdownLabel(text: string): string {
  return text.replace(/[[\]\\()]/g, (ch) => `\\${ch}`);
}