File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 1717 "@tailwindcss/vite" : " ^4.1.5" ,
1818 "@types/bun" : " latest" ,
1919 "hono" : " ^4.6.13" ,
20+ "tailwind-merge" : " ^3.3.0" ,
2021 "tailwindcss" : " ^4.1.5" ,
2122 "vite" : " ^6.2.5"
2223 }
Original file line number Diff line number Diff line change 11import type { FC } from "hono/jsx" ;
2+ import { twMerge } from "tailwind-merge" ;
23
34export type HtmlContentProps = {
45 html : string ;
@@ -7,7 +8,21 @@ export type HtmlContentProps = {
78export const HtmlContent : FC < HtmlContentProps > = ( { html } ) => {
89 return (
910 < div
10- class = "[&_img]:mx-auto [&_img]:block [&_img]:max-w-full"
11+ class = { twMerge ( [
12+ "overflow-hidden" ,
13+ "[&_img]:mx-auto" ,
14+ "[&_img]:block" ,
15+ "[&_img]:max-w-full" ,
16+ "[&_img]:h-auto" ,
17+ "[&_img]:object-contain" ,
18+ "[&_img]:w-auto" ,
19+ "[&_pre]:overflow-x-auto" ,
20+ "[&_pre]:max-w-full" ,
21+ "[&_pre]:whitespace-pre-wrap" ,
22+ "[&_pre]:break-all" ,
23+ "[&_pre_code]:block" ,
24+ "[&_pre_code]:w-full" ,
25+ ] ) }
1126 // biome-ignore lint/security/noDangerouslySetInnerHtml: typst-docsで生成されたHTMLを表示する
1227 dangerouslySetInnerHTML = { { __html : html } }
1328 />
You can’t perform that action at this time.
0 commit comments