Skip to content

Commit

Permalink
Fix markdown ordered list numbering (#4989)
Browse files Browse the repository at this point in the history
Co-authored-by: openhands <[email protected]>
  • Loading branch information
rbren and openhands-agent authored Nov 14, 2024
1 parent 27cd507 commit 52a428d
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions frontend/src/components/markdown/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@ import { ExtraProps } from "react-markdown";
// Custom component to render <ul> in markdown
export function ul({
children,
}: React.ClassAttributes<HTMLElement> &
React.HTMLAttributes<HTMLElement> &
}: React.ClassAttributes<HTMLUListElement> &
React.HTMLAttributes<HTMLUListElement> &
ExtraProps) {
return <ul className="list-disc ml-5 pl-2 whitespace-normal">{children}</ul>;
}

// Custom component to render <ol> in markdown
export function ol({
children,
}: React.ClassAttributes<HTMLElement> &
React.HTMLAttributes<HTMLElement> &
start,
}: React.ClassAttributes<HTMLOListElement> &
React.OlHTMLAttributes<HTMLOListElement> &
ExtraProps) {
return (
<ol className="list-decimal ml-5 pl-2 whitespace-normal">{children}</ol>
<ol className="list-decimal ml-5 pl-2 whitespace-normal" start={start}>
{children}
</ol>
);
}

0 comments on commit 52a428d

Please sign in to comment.