From 6264aa22d02a5b7af1df6bc4ba9ba9b0f03d83be Mon Sep 17 00:00:00 2001 From: Leilei332 Date: Sat, 24 Aug 2024 20:57:24 +0800 Subject: [PATCH] Fix unwrapped oveflowed code blocks not showing scroll bars when setting "Wrap long lines in code blocks" to "No" in "Theme tweaks" (#8413) * Fix unwrapped oveflowed code blocks not showing scroll bars * Inline code should not follow "Wrap long lines in code blocks" option * Revert "Inline code should not follow "Wrap long lines in code blocks" option" This reverts commit 4615a04e59760e57b600920d09d3538b577543c6. * Inline code should not obey "Wrap long lines in code blocks" option Fix problem described in #8549 --- themes/tiddlywiki/vanilla/base.tid | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index d95df90b1..8ad23e3a9 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -157,7 +157,7 @@ code { color: <>; background-color: <>; border: 1px solid <>; - white-space: {{$:/themes/tiddlywiki/vanilla/options/codewrapping}}; + white-space: pre-wrap; padding: 0 3px 2px; border-radius: 3px; font-family: {{$:/themes/tiddlywiki/vanilla/settings/codefontfamily}}; @@ -293,10 +293,13 @@ form.tc-form-inline { Markdown likes putting code elements inside pre elements */ pre > code { - padding: 0; + display: block; + padding: 0.5em; border: none; + white-space: {{$:/themes/tiddlywiki/vanilla/options/codewrapping}}; background-color: inherit; color: inherit; + overflow-x: auto; } /*