From de3adf905aff80e547dc630890f0d18bd87da880 Mon Sep 17 00:00:00 2001 From: Devin Weaver Date: Mon, 4 Apr 2016 12:27:55 -0400 Subject: [PATCH] Fix word wrapping in code blocks * Fix word wrapping in code blocks When you create a code block with the three back ticks any thing that was wider then the pre block would be word wrapped. That causes code snippets to look odd. * Make code wrapping a theme tweek option --- themes/tiddlywiki/vanilla/ThemeTweaks.tid | 1 + themes/tiddlywiki/vanilla/base.tid | 5 ++--- themes/tiddlywiki/vanilla/options.multids | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/themes/tiddlywiki/vanilla/ThemeTweaks.tid b/themes/tiddlywiki/vanilla/ThemeTweaks.tid index bfc4075b0..360c4b978 100644 --- a/themes/tiddlywiki/vanilla/ThemeTweaks.tid +++ b/themes/tiddlywiki/vanilla/ThemeTweaks.tid @@ -44,6 +44,7 @@ You can tweak certain aspects of the ''Vanilla'' theme. |[[Sidebar layout|$:/themes/tiddlywiki/vanilla/options/sidebarlayout]] |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/sidebarlayout"> | |[[Sticky titles|$:/themes/tiddlywiki/vanilla/options/stickytitles]]
//Causes tiddler titles to "stick" to the top of the browser window. Caution: Does not work at all with Chrome, and causes some layout issues in Firefox// |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/stickytitles"> | +|[[Wrap long lines in code blocks|$:/themes/tiddlywiki/vanilla/options/codewrapping]] |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/codewrapping"> | ! Settings diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index f1d942af9..324afee29 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -88,8 +88,7 @@ pre { margin-bottom: 1em; word-break: normal; word-wrap: break-word; - white-space: pre; - white-space: pre-wrap; + white-space: {{$:/themes/tiddlywiki/vanilla/options/codewrapping}}; background-color: <>; border: 1px solid <>; padding: 0 3px 2px; @@ -101,7 +100,7 @@ code { color: <>; background-color: <>; border: 1px solid <>; - white-space: pre-wrap; + white-space: {{$:/themes/tiddlywiki/vanilla/options/codewrapping}}; padding: 0 3px 2px; border-radius: 3px; font-family: {{$:/themes/tiddlywiki/vanilla/settings/codefontfamily}}; diff --git a/themes/tiddlywiki/vanilla/options.multids b/themes/tiddlywiki/vanilla/options.multids index 036092379..c0b49d961 100644 --- a/themes/tiddlywiki/vanilla/options.multids +++ b/themes/tiddlywiki/vanilla/options.multids @@ -2,3 +2,4 @@ title: $:/themes/tiddlywiki/vanilla/options/ stickytitles: no sidebarlayout: fixed-fluid +codewrapping: pre-wrap