Skip to content

Commit

Permalink
update markdown rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
breeg554 committed Dec 10, 2024
1 parent 4b672bd commit aeb8fe6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion apps/web-remix/app/components/chat/ChatMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ export const ChatMarkdown: React.FC<ChatMarkdownProps> = ({
a: Link,
img: Image,
strong: Strong,
hr: HR,
br: BR,
...options?.components,
}}
{...rest}
Expand Down Expand Up @@ -141,7 +143,7 @@ function Paragraph({
}: React.ParamHTMLAttributes<HTMLParagraphElement>) {
return (
<p
className={cn('my-2 break-words whitespace-pre-wrap text-sm', className)}
className={cn('my-2 break-words whitespace-normal text-sm', className)}
{...rest}
>
{children}
Expand Down Expand Up @@ -283,6 +285,17 @@ function H1({
);
}

function HR({
className,
...rest
}: React.ParamHTMLAttributes<HTMLHeadingElement>) {
return <hr className={cn('break-words my-2', className)} {...rest} />;
}

function BR({ className, ...rest }: React.ParamHTMLAttributes<HTMLBRElement>) {
return <br className={cn('', className)} {...rest} />;
}

function Li({
children,
className,
Expand Down

0 comments on commit aeb8fe6

Please sign in to comment.