First Last Prev Next    No search results available
Details
: %cursor% leaves a space
Bug#: 26300
: smarttemplate4
: General
Status: RESOLVED
Resolution: FIXED
: PC
: Linux
: unspecified
: P2
: normal
: ---

:
:
:
:
:
  Show dependency tree - Show dependency graph
People
Reporter: reaganf2 <reaganf2@gmail.com>
Assigned To: Axel Grude <axel.grude@gmail.com>
:

Attachments
SmartTemplate 1.5 pre 17 (388.63 KB, application/x-xpinstall)
2017-02-27 10:40, Axel Grude
no flags Details
SmartTemplate 1.5 pre 20 (388.73 KB, application/x-xpinstall)
2017-02-27 12:47, Axel Grude
no flags Details


Note

You need to log in before you can comment on or make changes to this bug.

Related actions


Description:   Opened: 2016-11-03 13:09
I'm using the following SmartTemplate4 to create a template just to define a
Google Web Font for my email and place a signature at the bottom.

<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<font style="font-family: 'Roboto', serif">
<p>%cursor%</p>
<p>%sig%</p>
</font>

The %cursor% command, however, results in a blank space being inserted at the
top of the email, which propagates as I type causing minor annoyances. Is there
any way this space could be removed? The HTML output when I start writing a new
email is as follows: (Note the space between the <p> and </p> above Name)

<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
  </head>
  <body smarttemplateinserted="true" bgcolor="#FFFFFF" text="#000000">
    <div id="smartTemplate4-template">
      <link href="https://fonts.googleapis.com/css?family=Roboto"
        rel="stylesheet">
      <font style="font-family: 'Roboto', serif">
        <p> </p>
        <p>Name</p>
      </font></div>
  </body>
</html>
------- Comment #1 From Axel Grude 2016-11-05 13:51:20 -------
The space shouldn't matter much once you start typing as it doesn't reallly
show up at the end of the line. However your HTML is invalid, you cannot have
<p> elements within a <font> tag. instead please use this:

<div style="font-family: 'Roboto', serif">
  <p>%cursor%</p>
  <p>%sig%</p>
</div>


(In reply to comment #0)
> I'm using the following SmartTemplate4 to create a template just to define a
> Google Web Font for my email and place a signature at the bottom.
> 
> <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
> <font style="font-family: 'Roboto', serif">
> <p>%cursor%</p>
> <p>%sig%</p>
> </font>
> 
> The %cursor% command, however, results in a blank space being inserted at the
> top of the email, which propagates as I type causing minor annoyances. Is there
> any way this space could be removed? The HTML output when I start writing a new
> email is as follows: (Note the space between the <p> and </p> above Name)
> 
> <html>
>   <head>
>     <meta http-equiv="content-type" content="text/html; charset=utf-8">
>   </head>
>   <body smarttemplateinserted="true" bgcolor="#FFFFFF" text="#000000">
>     <div id="smartTemplate4-template">
>       <link href="https://fonts.googleapis.com/css?family=Roboto"
>         rel="stylesheet">
>       <font style="font-family: 'Roboto', serif">
>         <p> </p>
>         <p>Name</p>
>       </font></div>
>   </body>
> </html>
> 
------- Comment #2 From reaganf2 2016-11-05 14:05:53 -------
:-) Thanks for pointing out the error in my HTML code. I've now corrected it.

Just to clarify, the space doesn't really matter as long as it ends up at the
end of the sentence I'm typing. If, however, I click into the email body field
of the Thundebird composition window and then start typing, there are times it
ends up at the beginning of the sentence, which causes a funny indent on the
first line.
------- Comment #3 From Shawn Lipscomb 2017-02-27 08:32:41 -------
I use this simple template for new messages (dashed lines not included):
============
%cursor%

- Shawn
============

These are plain text emails.  Smart Template replaces the %cursor% with a
space, which looks bad if I end up clicking inside of the email body instead of
tabbing to it, because then my email starts with a space.
------- Comment #4 From Axel Grude 2017-02-27 10:40:26 -------
Created an attachment (id=8273) [details]
SmartTemplate 1.5 pre 17

try this version with the global setting "insert space to highlight cursor"
disabled. Just tested in plain text mode on Tb 52.0b3
------- Comment #5 From reaganf2 2017-02-27 10:54:23 -------
(In reply to comment #4)
> Created an attachment (id=8273) [details] [details]
> SmartTemplate 1.5 pre 17
> 
> try this version with the global setting "insert space to highlight cursor"
> disabled. Just tested in plain text mode on Tb 52.0b3
> 

This version does something different altogether. My Compose template reads:

<div style="font-family:serif; font-size: 17px;">
  <p>%cursor%</p>
  <p>Reagan</p> (inserted using %sig%)
</div>

When I open a compose window, however, I see my name on the first line, with
the first <p></p> completely ignored.
------- Comment #6 From Axel Grude 2017-02-27 12:13:57 -------
(In reply to comment #5)
> (In reply to comment #4)

> This version does something different altogether. My Compose template reads:
> 
> <div style="font-family:serif; font-size: 17px;">
>   <p>%cursor%</p>
>   <p>Reagan</p> (inserted using %sig%)
> </div>


what's your template? is it this:

<div style="font-family:serif; font-size: 17px;">
  <p>%cursor%</p>
  %sig%
</div>
------- Comment #7 From reaganf2 2017-02-27 12:18:57 -------
That's right. Sorry if I wasn't clear earlier.
------- Comment #8 From Axel Grude 2017-02-27 12:24:21 -------
(In reply to comment #5)
> (In reply to comment #4)
> > Created an attachment (id=8273) [details] [details] [details]
> > SmartTemplate 1.5 pre 17
> > 
> > try this version with the global setting "insert space to highlight cursor"
> > disabled. Just tested in plain text mode on Tb 52.0b3
> > 
> 
> This version does something different altogether. My Compose template reads:
> 
> <div style="font-family:serif; font-size: 17px;">
>   <p>%cursor%</p>
>   <p>Reagan</p> (inserted using %sig%)
> </div>
> 
> When I open a compose window, however, I see my name on the first line, with
> the first <p></p> completely ignored.
> 
It's a bug in Thunderbird's (Mozilla's) HTML editor, in order to show a
completely empty paragraph you must add a <br> inside it (at the end):

<div style="font-family:serif; font-size: 17px;">
   <p>%cursor%<br></p>
   %sig%
</div>

Inadvertently this bug fix (removing the space) makes the paragraph disappear
as well. Not sure how to fix this (yet). Apparently it's "Fix one thing for 2
users, break another for 500."
------- Comment #9 From reaganf2 2017-02-27 12:27:33 -------
Brilliant! The <br> fixes the problem. Thanks so much for this!
------- Comment #10 From Axel Grude 2017-02-27 12:47:17 -------
Created an attachment (id=8275) [details]
SmartTemplate 1.5 pre 20

I added some code that avoids the edge case you found:

if the space (which I have created temporarily replacing the %cursor% tag) is
the only thing contained within the <p> tag I will now insert a <br> after it.
Once you edit this will look the same as if you were within a <p></p> pair:

<p>type text at cursor position<br>
</p>

in composer (and other email clients) this will look the same as:

<p>type text at cursor position</p>
------- Comment #11 From reaganf2 2017-02-27 14:25:48 -------
Works like a charm! Thanks so much!

First Last Prev Next    No search results available