Skip to content

Commit

Permalink
fix: katex overflow
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <[email protected]>
  • Loading branch information
Innei committed Apr 4, 2024
1 parent bb3dbf4 commit 42c4e41
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
33 changes: 17 additions & 16 deletions src/app/(app)/thinking/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ const List = () => {
className="size-[40px] rounded-full ring-2 ring-slate-200 dark:ring-zinc-800"
/>
</div>
<div>
<div className="min-w-0 max-w-full">
<div className="flex items-center space-x-2">
<span className="text-lg font-medium">{owner.name}</span>

Expand All @@ -211,22 +211,23 @@ const List = () => {
</span>
</div>

<div
className={clsx(
'relative inline-block rounded-xl p-3 text-zinc-800 dark:text-zinc-200',
'rounded-tl-sm bg-zinc-600/5 dark:bg-zinc-500/20',
'max-w-[calc(100%-3rem)]',
)}
>
<Markdown>{item.content}</Markdown>

{!!item.ref && (
<div>
<RefPreview refModel={item.ref} />
</div>
)}
<div className="relative min-w-0 grow">
<div
className={clsx(
'relative inline-block rounded-xl p-3 text-zinc-800 dark:text-zinc-200',
'rounded-tl-sm bg-zinc-600/5 dark:bg-zinc-500/20',
'max-w-full overflow-auto',
)}
>
<Markdown>{item.content}</Markdown>

{!!item.ref && (
<div>
<RefPreview refModel={item.ref} />
</div>
)}
</div>
</div>

<div
className={clsx(
'mt-4 space-x-8 opacity-50 duration-200 hover:opacity-100',
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui/markdown/parsers/katex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export const KateXBlockRule: MarkdownToJSX.Rule = {
},
react(node, _, state?) {
return (
<div key={state?.key}>
<div className="scrollbar-none overflow-auto" key={state?.key}>
<LateX mode="display">{node.groups.content}</LateX>
</div>
)
Expand Down

0 comments on commit 42c4e41

Please sign in to comment.