Description

When using preformatted text (e.g. CLI output), all stylesheets are containing code which are causing a linebreak. Often, this is unwanted because one line should stay one line (else, results are unreadable and/or can not be selected by triple-click anymore)

Afaik, there is no way to override the

pre {
    ...
        white-space: pre;
        /* begin css 3 or browser specific rules - do not remove!
        see: http://forums.techguy.org/archive/index.php/t-249849.html */
    white-space: pre-wrap;
    word-wrap: break-word;
    white-space: -moz-pre-wrap;
    white-space: -pre-wrap; -o-pre-wrap;
} 

settings from the common.css stylesheet with local customizations. Therefore, they should be removed. User can add them to his local stylesheet when he really wants them.

Steps to reproduce

  1. Create page with content like: This are two logfile entries:

    Feb 15 20:29:18 mail@londo sendmail[8480]: l1FJTIHR008480: from=<fedora-extras-commits-bounces@redhat.com>, size=32491, class=0, nrcpts=1, msgid=<200702151925.l1FJPSQT031448@cvs-int.fedora.redhat.com>, proto=ESMTP, daemon=MTA, relay=usertasks.bigo.ensc.de [192.168.46.146]
    Feb 15 20:29:20 mail@londo sendmail[8532]: l1FJTJe8008532: from=<fedora-package-review-bounces@redhat.com>, size=4464, class=-100, nrcpts=1, msgid=<200702151928.l1FJSElT002867@bugzilla.redhat.com>, proto=ESMTP, daemon=MTA, relay=usertasks.bigo.ensc.de [192.168.46.146]
    As you can see, moinmoin renders them nearly unreadable.

MoinMoin Version

1.5.7

OS and Version

Python Version

Server Setup

Server Details

Language you are using the wiki in (set in the browser/UserPreferences)

Workaround

Discussion

You can override anything in your personal stylesheet. This work for me in a personal css:

pre {
    white-space: pre;
    word-wrap: normal;
}

User css does not work with Firefox when used on a wiki page using action=raw, because the wiki returns content type of text/plain and Firefox requires text/css. A solution is to attach your personal css file to your home page, then use the url http://yourwiki/YourName?action=AttachFile&do=get&target=personal.css. Another solution is to host the css file elsewhere.

If you don't want to use a personal css, the best solution is to remove the wrapping rules in your wiki stylesheet (assuming your are the admin of the wiki). Then after you solved your problem, suggest the solution as a feature request.

Another global workaround can use an emdebbed stylesheet in HTML HEAD, in the wiki configuration. This puts the css config inline, and marks it important so that it overrides what comes later. Like the style above, this would cause some lines to bleed off the edge of the page, but to me that is better than ambiguous wrapping.

html_head = """<style type="text/css">pre { white-space: pre !important; word-wrap: normal !important; } </style>"""

It is one of possible solutions of handling long pre text — wrap it. The other is to use scrollbars and the second is to left all as is (and ruin page layout, aha). Moin developers have decided to wrap it. Trac devs, for example, have decided to use scrollbars, and every choice has its benefits and drawbacks. «results … can not be selected by triple-click anymore» — works ok in FF 3.6, at least. — -- EugeneSyromyatnikov 2010-03-03 14:21:04

Plan


CategoryMoinMoinNoBug

MoinMoin: MoinMoinBugs/PreformattedTextWillBeWrapped (last edited 2010-03-03 14:21:05 by EugeneSyromyatnikov)