MCPcopy Create free account
hub / github.com/continuedev/continue / removeCodeBlocksAndTrim

Function removeCodeBlocksAndTrim

core/util/index.ts:198–207  ·  view source on GitHub ↗
(text: string)

Source from the content-addressed store, hash-verified

196 * Return modified message text.
197 */
198export function removeCodeBlocksAndTrim(text: string): string {
199 const codeBlockRegex = /```[\s\S]*?```/g;
200 const thinkBlockRegex = /<think>[\s\S]*?<\/think>/g;
201
202 // Remove code blocks and think blocks from the message text
203 let processedText = text.replace(codeBlockRegex, "");
204 processedText = processedText.replace(thinkBlockRegex, "");
205
206 return processedText.trim();
207}
208
209export function splitCamelCaseAndNonAlphaNumeric(value: string) {
210 return value

Callers 4

index.test.tsFile · 0.85
sanitizeMessageForTTSFunction · 0.85
describeMethod · 0.85

Calls 1

replaceMethod · 0.45

Tested by 1

describeMethod · 0.68