Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

fix(markdown): don't break after list item number (#8181)

Nimar2351d0d370d3
diff --git a/web/src/components/ui/MarkdownViewer.tsx b/web/src/components/ui/MarkdownViewer.tsx
index d6c00e6260..c697086713 100644
--- a/web/src/components/ui/MarkdownViewer.tsx
+++ b/web/src/components/ui/MarkdownViewer.tsx
@@ -88,13 +88,12 @@ const isChecklist = (children: ReactNode) =>
const transformListItemChildren = (children: ReactNode) =>
Children.map(children, (child) =>
- isTextElement(child) ? (
- <div className="mb-1 inline-flex">
- {createElement(child.type, { ...child.props })}
- </div>
- ) : (
- child
- ),
+ isTextElement(child)
+ ? createElement("span", {
+ ...child.props,
+ className: cn(child.props.className, "mb-1"),
+ })
+ : child,
);
const isImageNode = (node?: ReactMarkdownNode): boolean =>