Ticket #8608 (closed defect: fixed)
Opened 2 years ago
Last modified 2 years ago
Code blocks overflow during preview
| Reported by: | Ryan Ollos <ryano@…> | Owned by: | rblank |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.12 |
| Component: | ticket system | Version: | 0.11.5 |
| Severity: | normal | Keywords: | |
| Cc: | |||
| Release Notes: | |||
| API Changes: | |||
Description (last modified by cboos) (diff)
I think this must have been reported already, but I've search and cannot find a bug report.
In a ticket, the code blocks overflow the screen (i.e. there is no scroll bar) during preview, as shown in the attached screen capture.
Actually, any wide enough content with a CSS specifying white-space: pre, like the following line generated using the [[span()]] macro:
a very long line ... a very long line ... a very long line ... a very long line ... a very long line ... a very long line ... a very long line ... a very long line …
Attachments
Change History
Changed 2 years ago by Ryan Ollos <ryano@…>
- Attachment CodeBlockOverflow.png added
comment:1 Changed 2 years ago by rblank
- Milestone set to 0.11.6
comment:2 Changed 2 years ago by cboos
No, it's not been reported before but briefly discussed in #8094, when I stumbled upon Sebastian's patch for that: https://svn.mayastudios.de/mtpp/browser/trac-patches/0.11/0.11.5/101_fix-ticket-preview-width.patch
However, I didn't feel like adding yet another hard-coded value in the CSS.
Problem is, I have no idea if there's another way.
Also, with the recently discussed idea on Trac-dev to have a layer on top of CSS (possibly {less}, preferably Genshi templates for the CSS files), we could use a variable for the ticket width and some expression reusing it for the ticket preview width. But that would be 0.12/0.13.
If there's a CSS expert out there who has a better idea, let us know.
In order to get a pragmatic solution for this long standing and annoying issue which was there for the whole 0.11.x period, maybe we can nevertheless apply Sebastian's patch for 0.11.6? Feedback welcomed... and actually Remy gave some feedback even before I asked for it ;-) Still, Remy, what do you think about that patch?
comment:3 Changed 2 years ago by cboos
Interestingly, IE8 seems not have a problem with the preview, and indeed the preview fieldset is contained within the .ticket#content div, the one which has width: 700px. So it should work in other browsers?
comment:4 Changed 2 years ago by cboos
Works also with Opera 9.64, but not with:
- Safari 4.0.3.
- Chrome 3.0.195.6.
- Firefox 3.5.2.
(all tested on Windows)
And yes, for the cases where it fails, this happens only when there's a white-space: pre involved somewhere in the content, not only a code-block.
e.g. with a span:
a very long line ... a very long line ... a very long line ... a very long line ... a very long line ... a very long line ... a very long line ... a very long line …
comment:5 Changed 2 years ago by Ryan Ollos <ryano@…>
I omitted the obvious important fact. I'm using Google Chrome 2.0.172.39 on Win Vista x64. If you have a good eye for browser styles you might have figured that out from the screen capture :)
comment:6 Changed 2 years ago by cboos
- Description modified (diff)
(adding the example from comment:4 in the description, so that all previews on this ticket will show the effect)
comment:7 Changed 2 years ago by rblank
This seems to be an issue with the preview <fieldset>. If I replace it with a <div>, formatting is correct.
comment:8 Changed 2 years ago by rblank
And we're not the only ones who seem to have noticed:
Incidentally, I have a suggestion for #8295 that removes the <fieldset>, which would fix this issue as well.
comment:9 Changed 2 years ago by rblank
The same issue also exists in the wiki page preview (try TracStandalone, for example). The solution is probably to avoid <fieldset> for previews.
comment:10 Changed 2 years ago by rblank
- Milestone changed from 0.11.6 to next-minor-0.12.x
Pushing out to next minor 0.12, in case #8295 actually does solve the issue.
comment:11 Changed 2 years ago by rblank
- Milestone changed from next-minor-0.12.x to 0.12
- Resolution set to fixed
- Status changed from new to closed
comment:12 Changed 2 years ago by rblank
- Owner set to rblank



We have commented on that in several tickets, but AFAIK there's indeed no explicit ticket. I'll look into this, but it's low priority at the moment. A working patch would obviously speed up the process :-)