From addfd9cd294ce010e894da6ccb1080f90df51bee Mon Sep 17 00:00:00 2001 From: Henry Fontanier Date: Wed, 30 Oct 2024 22:34:18 +0100 Subject: [PATCH] enh: support un-indented numbered lists (#8359) Co-authored-by: Henry Fontanier --- .../markdown/RenderMessageMarkdown.tsx | 17 ++++++++++++++--- front/lib/api/assistant/generation.ts | 4 ---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/front/components/assistant/markdown/RenderMessageMarkdown.tsx b/front/components/assistant/markdown/RenderMessageMarkdown.tsx index bf58cedb0281..b5b03873ba5b 100644 --- a/front/components/assistant/markdown/RenderMessageMarkdown.tsx +++ b/front/components/assistant/markdown/RenderMessageMarkdown.tsx @@ -420,26 +420,37 @@ function UlBlock({ children }: { children: React.ReactNode }) { ); } -function OlBlock({ children }: { children: React.ReactNode }) { +function OlBlock({ + children, + start, +}: { + children: React.ReactNode; + start?: number; +}) { return ( -
    {children}
+
    + {children} +
); } function LiBlock({ textSize, textColor, children, + className = "", }: { textSize?: string; textColor?: string; children: React.ReactNode; + className?: string; }) { return (
  • {children} diff --git a/front/lib/api/assistant/generation.ts b/front/lib/api/assistant/generation.ts index 48164cfa5f31..720bef4cf316 100644 --- a/front/lib/api/assistant/generation.ts +++ b/front/lib/api/assistant/generation.ts @@ -471,10 +471,6 @@ export async function constructPromptMultiActions( additionalInstructions += "\nWhen generating latex formulas, solely rely on the $$ escape sequence, single $ latex sequences are not supported.\n"; - additionalInstructions += - "\nIn numbered lists, align all content with the item's text to preserve list continuity " + - "in markdown - otherwise the list numbering breaks and restarts when rendered.\n"; - let prompt = `${context}\n${instructions}`; if (additionalInstructions) { prompt += `\nADDITIONAL INSTRUCTIONS:\n${additionalInstructions}`;