Opened 4 years ago

Closed 13 months ago

#1486123 closed Feature Patches (wontfix)

Inconsistent line-break on HTML-Plaintext-HTML switch

Reported by: mbo Owned by:
Priority: 5 Milestone: later
Component: User Interface Version: 0.3-stable
Severity: normal Keywords:
Cc:

Description (last modified by alec)

I've got a small bugfix in order to adjust a cosmetic defect. When switching from the html-editor while composing a mail to the plaintext-mode and then back to the html, the textbreaks work different caused by the <pre>-Tag...

Modified method in app.js:

this.plain2html = function(htmlText, id)

{

var url = this.env.bin_path+'text2html.php';
var rcmail = this;

this.set_busy(true, 'converting');
console.log('HTTP POST: '+url);

$.ajax({ async: false, type: 'POST', url: url, data: htmlText, contentType: 'application/octet-stream',

error: function(o) { rcmail.http_error(o); },
success: function(data) { rcmail.set_busy(false); $(document.getElementById(id)).val(data); console.log(data); }
});

}

Attachments (1)

text2html.php (538 bytes) - added by mbo 4 years ago.

Download all attachments as: .zip

Change History (9)

Changed 4 years ago by mbo

comment:1 Changed 3 years ago by alec

  • Milestone changed from later to 0.4-beta

We can do this on client-side. You have some test case for this "cosmetic defect"?

comment:2 Changed 3 years ago by mbo

  1. Compose a html-mail
  1. Press <A> <ENTER> <B> <ENTER> <C> <ENTER>
  1. Switch to plaintext-mode.
  1. Switch to html-mode.
  1. Place cursor behind <C>
  1. Press <D> <ENTER> <E> <ENTER> <F> <ENTER>
  1. Discover the differences ;-)

comment:3 Changed 3 years ago by alec

I'm not realy sure if we should fix this. We're using para's in HTML mode, then html2plain uses "\n\n" as paragraph separator. Changing from plain to html places the whole content inside <pre> block. I think this is ok. Problem is in 5. When you place cursor behind "C" you are still inside this <pre> block. If you'll make sure that you write really outside of this block (using html source window, I don't know if this is possible in other way), there will be no problem. So, I wouldn't call this as a defect or a bug. It's just how HTML works.
In your patch <pre> is not used. I don't think it's ok. You forgot about "\t", space identation, etc., which will be lost.

comment:4 Changed 3 years ago by mbo

But which user insert tabs into "webmail" text-mails? Every user pressing the tab-button focuse another html-object...

I prefer uniform breaks so I replace every \n\n to a new paragraph.

comment:5 Changed 3 years ago by alec

What if you reply to such message? BTW, space indentation is often used in plain text messages.

comment:6 Changed 3 years ago by mbo

When replying to text-messages and then switch to html, you have other problems (like in #1486311) ;-)

Perhaps this option can be variable (config-setting)?

comment:7 Changed 3 years ago by alec

  • Milestone changed from 0.4-beta to later
  • Summary changed from Composing: Switch from HTML to Plaintext to HTML to Inconsistent line-break on HTML-Plaintext-HTML switch

comment:8 Changed 13 months ago by alec

  • Description modified (diff)
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.