Improve article drawer word wrapping (#229)

This commit is contained in:
Yuan
2026-02-28 20:18:00 +08:00
committed by GitHub
parent 950b379676
commit 946f8f69ab
2 changed files with 16 additions and 7 deletions
@@ -237,7 +237,7 @@ export function ArticleDrawer() {
{/* Content */}
<ScrollArea className="min-h-0 flex-1">
<article className="px-5 py-6 sm:px-12 sm:py-8">
<article className="min-w-0 px-5 py-6 sm:px-12 sm:py-8">
<div className="space-y-3">
<h1 className="text-[28px] font-bold leading-[1.3]">
{article.title}
@@ -283,7 +283,7 @@ export function ArticleDrawer() {
</div>
<div
className="prose prose-neutral mt-6 max-w-none break-words dark:prose-invert"
className="prose prose-neutral mt-6 min-w-0 max-w-none break-words dark:prose-invert"
dangerouslySetInnerHTML={{
__html: processArticleContent(
article.content,
+14 -5
View File
@@ -137,18 +137,26 @@
/* Article content prose styles */
.prose {
overflow-wrap: break-word;
overflow-wrap: anywhere;
word-wrap: break-word;
word-break: break-word;
word-break: normal;
pre {
white-space: pre-wrap;
word-break: break-all;
overflow-wrap: anywhere;
word-break: normal;
overflow-x: auto;
}
pre code {
white-space: inherit;
overflow-wrap: inherit;
word-break: inherit;
}
code {
word-break: break-all;
overflow-wrap: anywhere;
word-break: normal;
}
img {
@@ -157,7 +165,8 @@
}
a {
word-break: break-all;
overflow-wrap: anywhere;
word-break: normal;
}
p:empty,