Page MenuHomePhabricator

Use pre { overflow:auto } to avoid overprinting
Closed, ResolvedPublic

Description

Author: dasch

Description:
I think pre tags should be formated through CSS with
overflow: auto;
Now the text inserted into pre, when it is to long, breaks the page layout and creates a horizontal scroll

see also http://de.wikipedia.org/wiki/Wikipedia:VV#Langer_Pre-Text


Version: 1.16.x
Severity: enhancement

Details

Reference
bz22060

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 10:55 PM
bzimport set Reference to bz22060.
bzimport added a subscriber: Unknown Object (MLST).

davidg wrote:

Using style="overflow:auto;" breaks badly in many browsers. So it is better to not use it and instead manually line wrap the examples we put in <pre> tags to avoid making them to wide.

dasch wrote:

well but most users do not wrap manually and whole pages are "broken" because of this

Sometimes I don't want lines in <pre> to wrap.... If it was to introduce automated wrapping, it should be optional: <pre wrap='auto'> or something (pre is treated like an extension tag, and not a literal html <pre> right?).

Also isn't there some work around for IE to make overflow:auto work? (position:relative or something)

ayg wrote:

(In reply to comment #1)

Using style="overflow:auto;" breaks badly in many browsers.

Which browsers, and how does it break? It could just be disabled for those browsers. It appears to work exactly as desired in Chrome 4, Firefox 3.5, and Opera 10.10. IE6 seems to treat it the same as overflow: visible, from a quick test, so it would just be the same as now.

IE6 doesn't support it.

IE7 and 8 draws the scrollbars INSIDE the contentbox (as the only browser, but per the HTML specification). So unless we know of a way to either make the contentbox for IE large enough to fit the scrollbar and have the content readable, this is indeed a tough one.

Well the obvious solution is to give a style rule in IEFixes
pre { padding-bottom: 2em}

(Currently padding is 1em, which is pretty big, and probably almost enough to hold the scroll bar. Perhaps it should be in pixels/absolute units, as i don't think scroll bars vary with font size).

  • This bug has been marked as a duplicate of bug 414 ***
  • This bug has been marked as a duplicate of bug 260 ***