Fake flowed for plaintext



19 years ago
11 years ago


(Reporter: BenB, Unassigned)


Firefox Tracking Flags

(Not tracked)



(3 attachments, 1 obsolete attachment)



19 years ago
Most mails I recieve
- are (non-"format=flowed") plaintext
- contain text that flowed when it had been composed
- do not contain ascii-art
However, some of them contain fixed lines, i.e. linebreaks matter, e.g. source

I would like these mails to be displayed as if they were format=flowed. I.e.
don't end the line on the screen, where it ends in the msg source, but continue
the paragraph until an empty line. It is an IMO logical extension to variable
width fonts and "wrap long lines". In other words, this feature is about
"wrapping all lines other than empty ones".

I consider this being more comfortable for reading, because I can adjust the
display width as I like, not at exactly 80 chars ("wrap long lines" doesn't
help, unless you adjust at exactly 40 chars).

I want to add a hidden pref, default off, to switch this on. Default off,
because it's only heuristic and is potentially destructive in the failure case.
Hidden, because this feature and its consequences are hard to communicate to
average users.

- Generally, output neither <br> nor <pre>.
- Insert <p>, if an empty line is detected.
- Address the "source-code problem" with a bit more heuristic:
  - If a line contains less than n chars (with n ~ 60), insert <br>, if the next
line is empty.

I am working on it right now.


19 years ago
Severity: normal → enhancement
Target Milestone: --- → M18

Comment 1

19 years ago
I have this working in my tree. Will attach patch after more testing/finetuning.

Comment 2

19 years ago
> if the next line is empty.

before each line until the next empty line.

Comment 3

19 years ago
Created attachment 12383 [details]
Example 1

Comment 4

19 years ago
Created attachment 12384 [details]
Examle 1 in composer (reply). Note the flow after snipping.

Comment 5

19 years ago
Created attachment 12385 [details]
Example 2, source code. This is a random part of C++ code.

Comment 6

19 years ago
Created attachment 12386 [details]
Example 3, supercite quote. (Used by Emacs/VM users.) This is one of the worst failures I could find.

Comment 7

19 years ago
Added a bit more heuristics. Now works (mostly) fine for bugzilla spam and
supercite quotes (so, the example 3 screenshot is invalid).

The majority of the new code is only executed, if the pref
"mail.all_plaintext_flowed" is enabled.

- removed old ifdefs
- preallocate a reasonably sized string using |SetCapacity|, so it should run
faster, if the pref is off.
- fixed a leak in a failure case

Rich, can you review, please?

In the long term, this functionality should be added to the generic TXT->HTML
converter mozTXTToHTMLConv, but we'd have to use it as stream converter in
libmime then, which is non-trival.
Keywords: review

Comment 8

19 years ago
Need a bit more time. Sorry.

Hacking in some support for ASCII-art detecting (need to do most of it anyway
for this bug) - see bug 20195.
Keywords: review

Comment 9

19 years ago
Moving out to M20, out of pity for poor Netscape :). Hope, it won't rott.
Target Milestone: M18 → M20

Comment 10

19 years ago
Tell me, why didn't I attach a patch? Or at least make a local backup? I tried
to delete ~/.mozilla, but actually deleted ~/mozilla, the folder with all my
changes :-(((. All lost. Hurray.


18 years ago
Target Milestone: M20 → mozilla0.9.1

Comment 11

18 years ago
for mozTXTToHTMLConv
Component: MIME → Networking
Product: MailNews → Browser
Target Milestone: mozilla0.9.1 → ---

Comment 12

18 years ago
Changing personal priorities. Giving away most of my bugs :-( (reassigning to
default owner).

I will still track these bugs closely. If you need my input, feel free to ask me.

New owner: Please do *not* close these bugs (as WONTFIX or whatever you may
find) unless they are fixed. Rather, reassign to <nobody@mozilla.org>, if you
don't want to work on them.
Assignee: mozilla → neeti
QA Contact: lchiang → tever

Comment 13

18 years ago
reassign to nobody@mozilla.org
Assignee: neeti → nobody

Comment 14

18 years ago
mass move, v2.
qa to me.
QA Contact: tever → benc

Comment 15

14 years ago
-> mailnews
Assignee: nobody → sspitzer
Component: Networking → Networking: MailNews General
Product: Browser → MailNews
QA Contact: benc → grylchan
Product: MailNews → Core
sorry for the spam.  making bugzilla reflect reality as I'm not working on these bugs.  filter on FOOBARCHEESE to remove these in bulk.
Assignee: sspitzer → nobody

You can Message -> Edit as New, and then Edit -> Rewrap.

Giving more visibility.
Component: MailNews: Networking → Mail Window Front End
Priority: P3 → --
Product: Core → Thunderbird
QA Contact: grylchan → front-end
Version: Trunk → unspecified

Comment 18

11 years ago
Joshua, this needs to be fixed in libmime, specifically mozTXTToHTMLConv, that's why it was Core.

Comment 19

11 years ago
eh, I mean mimetpla.cpp


11 years ago
Attachment #12386 - Attachment is obsolete: true
Unless I'm mistaken, mimetpla.cpp != Networking,
You need to log in before you can comment on or make changes to this bug.