diff --git a/components/elements/response.tsx b/components/elements/response.tsx
index 7f2f783bb..1eebc685b 100644
--- a/components/elements/response.tsx
+++ b/components/elements/response.tsx
@@ -80,6 +80,14 @@ function downloadTextFile(filename: string, content: string, type: string) {
URL.revokeObjectURL(url);
}
+function normalizeMarkdownContent(value: string) {
+ return String(value || "")
+ .replace(/\r\n/g, "\n")
+ .replace(/[ \t\u00a0]+\n/g, "\n")
+ .replace(/\n[ \t\u00a0]*\n(?:[ \t\u00a0]*\n)+/g, "\n\n")
+ .trim();
+}
+
function splitMarkdownImages(content: string) {
const segments: Array<
| { type: "text"; value: string }
@@ -275,7 +283,7 @@ function DownloadableMarkdownTable({
};
return (
-
+