MCPcopy Index your code
hub / github.com/coder/coder / sanitizeInstructionMarkdown

Function sanitizeInstructionMarkdown

agent/agentcontextconfig/api.go:304–310  ·  view source on GitHub ↗

sanitizeInstructionMarkdown strips HTML comments, invisible Unicode characters, and CRLF line endings from instruction file content.

(content string)

Source from the content-addressed store, hash-verified

302// Unicode characters, and CRLF line endings from instruction
303// file content.
304func sanitizeInstructionMarkdown(content string) string {
305 content = strings.ReplaceAll(content, "\r\n", "\n")
306 content = strings.ReplaceAll(content, "\r", "\n")
307 content = markdownCommentPattern.ReplaceAllString(content, "")
308 content = invisibleRunePattern.ReplaceAllString(content, "")
309 return strings.TrimSpace(content)
310}
311
312// discoverSkills walks the given skills directories and returns
313// metadata for every valid skill it finds. Body and supporting

Callers 1

readAndSanitizeFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected