<pre> (pre-formatted) section is the xhtml translation of <code> of <file> dokuwiki elements.
It means the format of the content will be unchanged (spaces and end-of-line are respected)
For very long line (even with spaces in it), the <pre> element will be displayed as a very large section on the html page.
Since the rest of this html page is not within the preformatted section, its content will wrap itself and take the full width of the html page, (width wich is very very large due to the very long line within a <pre> section)
That makes the reading of such a page quite unpractical, with the constant use of horizontal scrollbar to read the full content of the page…
See also Feature Request #370 — Daniel Chaffiol 2005/06/03
Add a wrap mode for <pre> css element:
add after all css pre rules fo the design.css file in your favorite dokuwiki\template directory :
pre { white-space: pre-wrap; /* css-3 */ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ word-wrap: break-word; /* Internet Explorer 5.5+ */ }
For this to work on Internet Explorer, the width of the code box needs to be fixed. -franliu [at] adelphia [dot] net 14/09/05
Even if such a 'feature' (no wrap for <pre> content) might be usefull, it should be given the choice to the writer to choose between wrap and no wrap for the content of a pre-formatted text.
One could use the multiple class on a css element, and use the previous css rule with a 'pre.wrap'.
That rule will add its 'wrap effect' to the previous 'pre.code' or 'pre.file' rules, provided that the xhtml code takes into account the wrap option and generates a <pre class="code,wrap">... xhtml code.
What form should take that wrap option ?
What is your feedbacks on that issue ?
Daniel Chaffiol 31/05/2005
I would think it is best implemented as a template which contains a modified CSS containing your quick fix.
— Chris 2005-05-31If the quick fix was the only solution, then yes, you are right, a dedicated templated should be created.
But with multiple class on a css element, I would rather modify design.css of the default template, and add a pre.wrap rule:
if no <pre class="...[code or file or...],wrap"> is ever generated, then this rule would never apply.
if, because of a “wrap mode”, a <pre class="...[code or file or...],wrap"> is generated, then this “pre” section would be wrapped.
That rule can be then safely copied from template to template, and has nothing to do with a dedicated template, since it is linked with a generic “wrap mode” from the dokuwiki php engine. Daniel Chaffiol 31/05/2005