mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-07-16 08:03:15 +02:00
update code block (#2297)
This commit is contained in:
@ -50,6 +50,12 @@ export function CodeBlock({
|
|||||||
);
|
);
|
||||||
codeText = codeText.trim();
|
codeText = codeText.trim();
|
||||||
|
|
||||||
|
// Find the last occurrence of closing backticks
|
||||||
|
const lastBackticksIndex = codeText.lastIndexOf("```");
|
||||||
|
if (lastBackticksIndex !== -1) {
|
||||||
|
codeText = codeText.slice(0, lastBackticksIndex + 3);
|
||||||
|
}
|
||||||
|
|
||||||
// Remove the language declaration and trailing backticks
|
// Remove the language declaration and trailing backticks
|
||||||
const codeLines = codeText.split("\n");
|
const codeLines = codeText.split("\n");
|
||||||
if (
|
if (
|
||||||
|
Reference in New Issue
Block a user