diff --git a/basic-messenger-cli/application/src/index.ts b/basic-messenger-cli/application/src/index.ts index cbe0246..5f77c13 100644 --- a/basic-messenger-cli/application/src/index.ts +++ b/basic-messenger-cli/application/src/index.ts @@ -25,15 +25,15 @@ const init = async (): Promise => { rl.on("line", async (input: string) => { if (input.trim().length > 0) { const output = await client.send(input); - console.log(chalk.green("Assistant: ") + boldify(output)); + console.log(chalk.green("Assistant: ") + format(output)); } rl.prompt(); }); }; -// Utility function to replace **text** with chalk.bold(text) -function boldify(text: string): string { - return text.replace(/\*\*(.*?)\*\*/g, (_, value) => chalk.bold(value)); +function format(text: string): string { + let retval = text.replace(/<[^>]*>/g, ""); + return retval.replace(/\*\*(.*?)\*\*/g, (_, value) => chalk.bold(value)); } init(); \ No newline at end of file