#8608 closed defect (fixed)
Code blocks overflow during preview
Reported by: | Owned by: | Remy Blank | |
---|---|---|---|
Priority: | normal | Milestone: | 0.12 |
Component: | ticket system | Version: | 0.11.5 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
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 (1)
Change History (13)
by , 15 years ago
Attachment: | CodeBlockOverflow.png added |
---|
comment:1 by , 15 years ago
Milestone: | → 0.11.6 |
---|
comment:2 by , 15 years ago
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 by , 15 years ago
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 by , 15 years ago
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 by , 15 years ago
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 by , 15 years ago
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 by , 15 years ago
This seems to be an issue with the preview <fieldset>
. If I replace it with a <div>
, formatting is correct.
comment:8 by , 15 years ago
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 by , 15 years ago
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 by , 15 years ago
Milestone: | 0.11.6 → next-minor-0.12.x |
---|
Pushing out to next minor 0.12, in case #8295 actually does solve the issue.
comment:11 by , 15 years ago
Milestone: | next-minor-0.12.x → 0.12 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
comment:12 by , 15 years ago
Owner: | set to |
---|
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 :-)