MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / sanitizeMarkdown

Function sanitizeMarkdown

src/utils/validation.js:125–136  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

123}
124
125export function sanitizeMarkdown(text) {
126 if (typeof text !== 'string') return '';
127
128 return text
129 .replace(/\*/g, '\\*')
130 .replace(/_/g, '\\_')
131 .replace(/`/g, '\\`')
132 .replace(/\[/g, '\\[')
133 .replace(/\]/g, '\\]')
134 .replace(/\|/g, '\\|')
135 .replace(/~/g, '\\~');
136}
137
138export function sanitizeInput(input, maxLength = 2000) {
139 if (typeof input !== 'string') return '';

Callers 2

executeFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected