New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unwanted empty lines in reply/forward headers in plain-text emails #54
Comments
Just sent this to you using GitHub direct email. |
hmm, not sure if I got that... can you send it to realraven2000@hotmail.com? |
done. |
thanks, I got it now. Turns out Hotmail now also have a aggressive anti Spam policy like google, so I to recover the mail to see it on my POP3 account. I understand your default is HTML (like most) and you force plaintext by holding SHIFT when clicking on the reply button.. Should be easy enough to replicate. plaint text is the unloved stepchild of the SmartTemplate developer team (me). ;) |
Ok, I managed to load your template, let's have a look at the output when I force text mode with SHIFT: it looks like there is additional space on the quote header lines (From: , Sent: , Cc: etc.). In source code it looks quite innocuous:
Once I delete the extra line breaks in editor, this removers the
So this means the text node treats textual line breaks (and not just |
... having said this: I just reserved some space on another partition with some restored data, so here is a test version with an attempted fix: smartTemplate-fx-2.9.2pre5.zip It only will fix the quote text if the following conditions apply
|
I tried v2.9.2pre5 (still reported as v2.9.1). Two issues:
but in the plain-text response email, there is no extra empty line between the reply header and the body text, which is odd:
Since there will never be a case where the first line of body text is appended to the subject line, the last <br> in the reply header should mean that there is one empty line. This would also be consistent with the HTML handling where there is also some space between the last line of the header and the first line of body text. Secondly, the changes did nothing for the large amount of extra white space around the signature, "where you write your response text". |
That looks like what you asked it to do.... blockquote starts straight after the last (single)
You mean quoted text, right? Blockquote is a
I think this is just margin-top of blockquote. I don't think Smarttemplate should always insert an extra empty line before the quote.
??? Your template made no sense to me- it's only %sig(2)% and noting else - no salutation, no cursor - why? Where do you write, above or below your signature? Also i don't believe i have your signature, is it HTML or plain text? |
Yes, adding a second My default signature I sent you in my email on 2/14, both as screenshot and as HTML text. There is nothing special in it but it is in HTML format and therefore difficult to post here because the tags are getting removed. Yes, I only use |
Cc: Some Name some@email.de
(now on my desktop browser) this looks correct to me. This is the default behavior, with SmartTemplate disabled: so as you can see - no extra space between the quote header " So the new line removal seems to work fine. and SmartTemplate is replacing the quote header line with whatever you give it. In source code (plain text) that Thunderbird standard quote header followed by blockquote part looks like this:
In source, there is an extra
which will give you this result: |
Yes, you're right, the |
alright - in the future just use highlight any code and then use the
I think that's a little bit unfortunate, I would instead take it out of the signature and would instead change the template to something like this:
Yeah I didn't dig out the email, I get soo much support mail that it is hard to keep track :)
Not a problem, just semantically what you are doing is "writing in the signature" and not in the template, so it may present some problems if you try to style in HTML later. Personally my default (and recommended) pattern is like this:
I can use that as a common template with different signatures - you obviously do not need the following optional parts:
so at its core you are left with this minimal approach:
The quote would be displayed separate to the And then you can do a bit of trickery for styling stuff in your way (hence |
That's nice! I started playing with it and it really is better. |
Nah, for the signature the spacing is still too big. I have used your core/minimal approach for the ST4 signature, just removing the identation and I have defined a really simple signature in TB for testing: But as plain-text reply, this looks like this: So yes, there is still a full line between "Best Regards" and "Chris". And an extra line after "Chris". And an extra line between the cursor and "Best Regards". |
Oh, and an extra line before the cursor as well. |
to get a better idea of what is really happening, I highly recommend installing the Add-on ThunderHtmlEdit, where you can switch back and forth between the view and the HTML behind that. Now with the HTML editor you an actually influence the distance for the Example:
Now it obviously depends on the content of your sig on what's at the bottom and may generate extra spacing towards your quote header. You will only know when looking into the "generated HTML" in ThunderHTMLEdit (within Thunderbird Composer). You can check the actual values using the "inspector" tool of the main Thunderbird window (tools menu). You can then select the composer document from the document chooser on the top right: you can then use the "inspector" top left for clicking on elements in the composer window and the "Layout" tab on the right to tell us about what it does distance-wise: the "box model" tells us the full truth: as you see, this stuff isn't exactly easy or easy to explain, but it's well worth the learning curve... |
I remember this working really well, waaay back with old versions of TB and the predecessor of your add-on. And then, little by little, as TB "progressed", it all fell apart. Anyway, thanks for your explanations and I will look into it, but my main problem seems to be that I can't find a way to have HTML signatures where individual lines don't get separated by extra lines in plain text emails. Do you have an idea for this? Just multiple lines in HTML that stay that way in plain text. |
maybe we have the same problem as in your quote header (I had to do some modifications to deal with that)? Can you put your signature here (just mask personal info such as email addresses with ***) You can easily post multi-line code in github and then highlight and press the insert code button afterwards, which will wrap it with "triple apostrophes" which is markdown for "leave this alone" ;) (check the preview tab to try it out). Example for a sig (css rules stripped for brevity):
that one gets nicely "stripped down" in plain text mode here (I probably have to set up my test identity better so that %identity(name)% is properly resolved, but it may be another bug i need to investigate:
|
Ok I spoke too soon - I actually tested while I had the template disabled on the accounbt, I am getting a very interesting "bastardized" mixture in plain text mode. First in HTML , for comparison: and now in "plain text" (ish) mode - holding down SHIFT while replying: So there still are plenty of extra lines in the signature box and even the body of the template itself,. Looks like I only solved the problem for the quote header. but that's to be expected when we fix a single thing only. I will keep testing. Still don't quite understand why there is even styling shown in a "plain text" window... plain text, the unloved stepchild of SmartTemplate4 ;) I believe all extra line breaks are "HTML formatting" which can be stripped out, as I did in the quote header. |
OK, here is a trial version: smartTemplate-fx-2.9.2pre15.zip ... which is hopefully a little bit better in plain text. (not quite there yet, but closer) improved output in plain text mode, with definitely a lot less uselss line breaks: |
Yes, this version fixes it for me - great! Why do you say "not quite there yet"? AFAICS this version handles line breaks perfectly - I am getting exactly the same in both HTML and plain-text responses. BTW the fact that one is getting HTML-fomatted text for the reply header, signature etc. in a plain-text compose window is one of the oddities that TB introduced at some point. I remember "back in the old days", a plain-text compose window really meant plain-text when writing your email. But honestly, as long as I can rely on the format being ok when the email goes out, I don't care anymore. Just one more strange thing to live with I guess. |
If you look at the screenshot of the signature there is a line break after the "Quickpasswords" Hyperlink. AFAIK it should break after 72 characters, so this looks a little early to me. Also the leading spaces are definitely ugly. I wonder if HTML should at least "collapse" all white spaces to a single one. Finally replacing newlines with nothing may lead to stuff "caking together" so replacement with a single space may be better. My safeguard at the moment is (not ideal) that I only do these replacements if the HTML snippet contains
it would be nice to have an alternative (text-only) alternative signature for this case but that also means additional identity management work for the user. The whole point about using CSS rules for HTML is that it "degrades gracefully" so that it still looks meaningful and well layouted when a mail client can only display text-only mails. |
Pretty sure these come from the indentation in your HTML template. I have manually removed them in mine - the HTML works just as well without. But yes, it would be nice if they could stay in without affecting the plain-text version.
True |
Would it be fair to say these are only leading spaces following block level elements / elements that insert line breaks? There may be a regular expression to take care of that... |
Yes, good so far. Just noticed there are extra spaces in the plain-text reply header where there shouldn't be. For example, this is the HTML version: And here is the plain-text version of the same replied-to email: I marked the extra space in yellow. Why the extra space only in the "Sent:" line? Well, I am using this construct:
Yes, there is a space before and after
But is is different behaviour between HTML and plain-text, nonetheless, and may also happen with other constructs that I am not using. |
Because HTML automatically "collapses" all spaces (and line breaks and tabs) into one single space. I was debating with myself whether I should do this during the plain text conversion or not; obviously getting rid of leading space was already a good start. But should all spaces be collapsed?
Also there may be an additional difficulty because the plain text conversion happens before SmartTemplate replaces its variables (IIRC) so it won't know that there will be a double space. Notwithstanding of me fixing the space issue I would recommend this more comfortable way of writing that:
In v 2.8, I have provided some multi-lingual examples on the variables tab, under the caption "Variables for customized 'Date format'": you can just click them to insert into your template. |
Yes, using %dateformat% is much nicer, thanks! You're probably right - some people may want to use extra spacing. |
Fixed in 2.10.1 released on 14/04/2020 |
Normally I use HTML emails and I have set my reply and forward headers the way I want them, with the "Use HTML" checkbox checked, the "Replace line breaks with <br>" unchecked (per the author's suggestion), and the <br> tags put directly in the quote header.
With some people, I want to use plain-text format in replies because they send such emails to me and have requested that I reply in kind. So as usual in TB, I keep the <Shift> key pressed while hitting the reply or forward button to compose the email in plain-text format. This works in principle but two issues:
The extra lines in the reply header come from the HTML header's <br> tags plus the regular line breaks. In HTML, they are interpreted correctly, i.e. don't lead to extra line breaks. In plain text, both are interpreted as line breaks. I guess that same thing happens with the HTML signature.
I can work around it by making the HTML reply header one super-long single line with <br> tags in between but it's not exactly nice. The regular line breaks should be simply ignored for plain-text emails if it is a "Use HTML" header.
BTW this doesn't happen if "Replace line breaks with <br>" is checked and I remove the <br> tags. But I don't want to use this option anymore because of other issues.
The text was updated successfully, but these errors were encountered: