Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

improve clearning of the md content output

0divf54657726cbb
diff --git a/packages/cli/src/utils/commands2md.ts b/packages/cli/src/utils/commands2md.ts
index 96948d2d9..6286e67d9 100644
--- a/packages/cli/src/utils/commands2md.ts
+++ b/packages/cli/src/utils/commands2md.ts
@@ -57,12 +57,15 @@ export function commands2md(commands: Command[]): void {
mdContent += subMdContent + '\n\n'
})
- // Clean the mdContent
+ // Clean the mdContent from terminal colors and escape HTML characters
mdContent = mdContent
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/\[1m/g, '')
.replace(/\[22m/g, '')
+ .replace(/\[34m/g, '')
+ .replace(/\[39m/g, '')
+ .replace(/\[38;2;255;183;102m/g, '')
return [fullName, mdContent]
}