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
print-window-tiddler
Devin Weaver 2016-04-04 12:27:55 -04:00 zatwierdzone przez Jeremy Ruston
rodzic 811aa23010
commit de3adf905a
3 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -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"><option value="fixed-fluid">Fixed story, fluid sidebar</option><option value="fluid-fixed">Fluid story, fixed sidebar</option></$select> |
|[[Sticky titles|$:/themes/tiddlywiki/vanilla/options/stickytitles]]<br>//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"><option value="no">No</option><option value="yes">Yes</option></$select> |
|[[Wrap long lines in code blocks|$:/themes/tiddlywiki/vanilla/options/codewrapping]] |<$select tiddler="$:/themes/tiddlywiki/vanilla/options/codewrapping"><option value="pre">No</option><option value="pre-wrap">Yes</option></$select> |
! Settings

Wyświetl plik

@ -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: <<colour pre-background>>;
border: 1px solid <<colour pre-border>>;
padding: 0 3px 2px;
@ -101,7 +100,7 @@ code {
color: <<colour code-foreground>>;
background-color: <<colour code-background>>;
border: 1px solid <<colour code-border>>;
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}};

Wyświetl plik

@ -2,3 +2,4 @@ title: $:/themes/tiddlywiki/vanilla/options/
stickytitles: no
sidebarlayout: fixed-fluid
codewrapping: pre-wrap