From 48f200f4442ff00d5d4676db22ef4f1b71bf2f7d Mon Sep 17 00:00:00 2001 From: Sat Naing Date: Tue, 18 Mar 2025 23:26:33 +0700 Subject: [PATCH] fix: prevent overflow by adding line breaks in table codes (#485) Horizontal overflow occurs when a code block in markdown table is too long. This is prevented by adding line breaks (`break-all`) in codes inside table. --- src/styles/typography.css | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/styles/typography.css b/src/styles/typography.css index 58c5820..0585c62 100644 --- a/src/styles/typography.css +++ b/src/styles/typography.css @@ -29,9 +29,15 @@ pre:has(code) { @apply border border-border; } - code, - blockquote { - word-wrap: break-word; + + .prose code, + .prose blockquote { + @apply break-words; + } + + .prose table code { + /* add line breaks whenever necessary for codes under table */ + @apply break-all; } pre > code {