Closed Bug 39728 Opened 25 years ago Closed 25 years ago

Don't generate   for flowed

Categories

(MailNews Core :: MIME, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: BenB, Assigned: BenB)

References

Details

Attachments

(2 files)

Split-off from bug 39370. At least in the quoting case (better always IMO), we really shouldn't use nbsp just to get fixed lines. Use e.g. - quoting - flowed paragraphs*: tt + br - fixed lines: pre or pre wrap - viewing wrap=on - flowed paragraphs*: tt + br or pre wrap - fixed lines: pre wrap - viewing wrap=off - flowed paragraphs*: tt + br or pre wrap - fixed lines: pre *the whole paragraph is one ling line; the same as the qp text converter does The proposed tags are open for discussion.
I just remembered another reason why   was used originally: * Multiple whitespace, for instance "Sentance with large spaces" Without   the whitespaces are compressed. (Bye, bye ASCII-art).
Daniel, no, pre preserves whitespace (at least it should).
But it removes the <tt> option above. There seems to be alternatives everywhere but for one place so if only that can be dealt with, maybe it's still possible.
Status: NEW → ASSIGNED
Target Milestone: --- → M20
Daniel, there is no ASCII-art in flowed paragraphs, is there?
Could be. There is no way to align two lines with eachother without explicit line breaks, but it's sure possible to send mails with multiple spaces anyway, and Mozilla should display them with multiple spaces. It could for instance be an indented first line in a paragraph. Like: This is a text that goes on and on and on and on and on and on and on and on and on and on and on and on and on and on and on...
ic, you could substitute all spaces in a row but the first one with &nsbr;. That's what the editor does.
Or make every other SPACE a &nbsp; ? That way you could wrap even if there were many spaces.
After private discussion pre email with Daniel, it turned out to be to just change the nbsp generation and not to use pre. (Comments are stil welcome, of course.) We can't use <pre wrap>, because it is a non-standard HTML extension, which MSIE doesn't support. Paragraphs are displayed as one long line. So, we indeed have to use tt for flowed paragraphs. Even flowed paragraphs can contain several spaces in a row, e.g. after a full stop or as indention of the first line. Editor decided to allow that in new HTML text, so we should do the same (for quoting, which was the issue. For display, noone but us reads the source :) ). We should duplicate the editor strategy which is, IIRC, to leave the forst space alone and turn all following (in a row) into nbsp. This strategy would also work for fixed lines. The only issue is that they would always wrap. It also is somewhat readable, so I see no big advantage in changing them to <pre>s. So, all we would have to do for this bug is to - change the space conversion strategy - check (and fix if needed), if we insert to many real linebreaks (I think, we're adding to extra ones) in order to make the source more readable. Looks easy!
Fixed this. REASSIGNing to myself. I'll attach the full source file mimetpfl.cpp (includes fix for bug 31906, thus depends on latest patch for that bug). It also fixes: - It seems like we collapsed multiple spaces/tabs in a row in flowed paragraphs (i.e. " " displayed as " "). - For fixed lines, the wrap pref wasn't honored, but hardcoded to "don't wrap". The changes for flowed paragraphs are untested, as this mode is broken on Unix (all lines are interpreted as fixed). Daniel, can you test and review, please? Example output: div class=text-flowed style="font-family: adobe-helvetica-iso8859-1; font-size 14px;"><tt> <br></tt><blockquote type=cite><tt>&gt; Ah, the problem wasn't the font size bu something much more <br>&gt; fundamental. Your code don't honor the mail.fixed_width_messages pref.<br>&gt; (That made your code display with a fixed font which was much larger <br>&gt; than my usual proportional width font). This is a MUSTFIX (obviously) <br>&gt; but I haven't looked into how to fix it and why it don't work. I think<br>&gt; the same problem is in both mimetpfl.cpp and mimetpla.cpp. <br> <br>WORKSFORME, I nearly all the time use variable width fonts. Dunno, why <br>it doesn't work for you. Maybe the *_begin function(s) give you a clue. <br>IIRC, in mimetpfl, it is queried directly and in mimetpla indirectly via <br><code class=txt-verticalline><span class=txt-tag>|</span>obj-&gt;p_variablewidth_font<span class=txt-tag>|</span></code> or so. <br></tt></blockquote><tt> <br>I found the problem as you've might have seen in bug 39963. &nbsp;It's <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;openingDiv += " styl=\""; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;openingDiv += fontstle; <br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;openingDiv += '\"'; <br> <br>that's referred to. The middle part is not working so no fontstyle is <br>added. [...]
Assignee: rhp → mozilla
Status: ASSIGNED → NEW
Whiteboard: Fixed. Waiting for polish, review and checkin.
Target Milestone: M20 → M17
Some chars in the example output have been truncated - don't worry.
Status: NEW → ASSIGNED
Attached file mimetpfl.cpp
Blocks: 40862
Fix checked in by rhp.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Reopening, because the conversion SPACE -> &nbsp; doesn't work for flowed paragraphs/lines in format=flowed mails.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Whiteboard: Fixed. Waiting for polish, review and checkin.
Taking the bug because I have a fix.
Assignee: mozilla → bratell
Status: REOPENED → NEW
The problem was that the nextSpaceIsNbsp variable was initialized _inside_ the loop (every iteration). Just moving two lines outside the loop fixes this. The fix is in the fix for bug 46173 (attachment 11763 [details] [diff] [review] <http://bugzilla.mozilla.org/showattachment.cgi?attach_id=11763>). Rich, can you review this in one piece or should I break it in two?
Status: NEW → ASSIGNED
Whiteboard: Fix waiting for review and approval.
It is better to file a new bug for this. What you see is the exact opposite of this bug, just a bug with the fix of this bug. Filed bug 46188. It matters, because I want to keep track of which bugs I fixed via bugzilla.
Whiteboard: Fix waiting for review and approval.
taking bug back.
Assignee: bratell → mozilla
Status: ASSIGNED → NEW
reset to fixed. sorry for the inconvience.
Status: NEW → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → FIXED
changing qa
QA Contact: lchiang → esther
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: