Edgewall Software
Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#10533 closed defect (fixed)

[Patch] Text in code format will be clipped when printing

Reported by: framay <franz.mayer@…> Owned by: franz.mayer@…
Priority: normal Milestone: 1.0
Component: query system Version: 0.13dev
Severity: major Keywords: css print code patch
Cc: Branch:
Release Notes:

Wrap content of code blocks in order to avoid truncation on screen and on print

API Changes:
Internal Changes:

Description

When there is a very long code line in a ticket or wiki page only the first characters will be printed. I would expect that all of the code is printed (with line breaks).

See sample on t.e.o demo-0.12 and on t.e.o demo-0.13

Attachments (2)

#4505 -(Neues Test Ticket für Code-Test-) – Trac 0.12 Demo Project.pdf (52.8 KB ) - added by framay <franz.mayer@…> 12 years ago.
Sample PDF when printing ticket
ticket-10533-trac.css.patch (349 bytes ) - added by framay <franz.mayer@…> 12 years ago.
Patch tested with IE 9, Google Chrome 16.0.912.77 m, Firefox 9.0.1

Download all attachments as: .zip

Change History (11)

by framay <franz.mayer@…>, 12 years ago

Sample PDF when printing ticket

comment:1 by Christian Boos, 12 years ago

Keywords: css added
Milestone: next-major-0.1X

PatchWelcome.

We currently have a pre.wiki { overflow: visible } in the @media print block, we could try with a white-space: pre-wrap instead.

by framay <franz.mayer@…>, 12 years ago

Attachment: ticket-10533-trac.css.patch added

Patch tested with IE 9, Google Chrome 16.0.912.77 m, Firefox 9.0.1

comment:2 by framay <franz.mayer@…>, 12 years ago

Keywords: patch added
Summary: Text in code format will be clipped when printing[Patch] Text in code format will be clipped when printing

Tested the patch with IE 9, Google Chrome 16.0.912.77 m, Firefox 9.0.1 and Trac 0.13dev-r10932. Works for Wiki pages as well as tickets.

comment:3 by framay <franz.mayer@…>, 12 years ago

Milestone: next-major-0.1X0.13

Maybe it could be included into milestone Trac 0.13?

comment:4 by Christian Boos, 12 years ago

Owner: set to franz.mayer@…

Looks good also for IE8 and Opera. IE7 doesn't support it, but no surprise there, as that one-line code block doesn't show up correctly even in normal mode ;-)

Thanks for the patch!

comment:5 by Christian Boos, 12 years ago

Resolution: fixed
Severity: majornormal
Status: newclosed

Applied in r10938.

comment:6 by Christian Boos, 12 years ago

Component: renderingquery system
Milestone: 0.130.12.4
Resolution: fixed
Severity: normalmajor
Status: closedreopened

Note that this problem is also present for other kind of pre blocks (not only div.code pre).

Even worse, in custom queries or in report listings, when the Description is rendered as wiki markup, the problem is not the presence of scrollbars but rather such long lines "force" the width of the whole column to take whatever space is needed to show them in full. This makes the other normal paragraphs to look like one long line. This makes the report on print completely useless as most of the content is off page. Even on screen this behavior is very damaging, as one need to scroll horizontally in order to read each long line…

See for example demo-0.12:query:?id=4505,4641,785,160,225,637&row=description

in reply to:  6 comment:7 by framay <franz.mayer@…>, 12 years ago

Replying to cboos:

See for example demo-0.12:query:?id=4505,4641,785,160,225,637&row=description

For screen it is the same behavior in this example on demo-0.13:query:?id=542,543&row=description. But when printing (print preview) the code line is displayed completely (correctly).

So this isn't a issue of printing, it is a issue of displaying code lines. Maybe you should move div.code pre { white-space: pre-wrap } out of @media print-section?!

Last edited 12 years ago by Christian Boos (previous) (diff)

comment:8 by Christian Boos, 12 years ago

Milestone: 0.12.41.0
Resolution: fixed
Status: reopenedclosed

Fixed in r11156.

Works well on all browsers supporting white-space: pre-wrap (all but IE7?), both on screen and on print.

comment:9 by Christian Boos, 12 years ago

Release Notes: modified (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain franz.mayer@….
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from franz.mayer@… to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.