Briskine / briskine

Write faster with templates and keyboard shortcuts.
https://www.briskine.com/
GNU General Public License v3.0
108 stars 23 forks source link

Single newline at the end of template adds multiple newlines when inserted #480

Closed DanKaplanSES closed 1 year ago

DanKaplanSES commented 2 years ago

Description

If my template ends in a newline, it inserts two in the Gmail body. Note that I have a signature in my emails, and this might be relevant to reproduction.

Steps to reproduce:

  1. Create a template like this: image
  2. Compose an email
  3. Click on the body to focus it (click on the first line)
  4. Type your template and expand it

Expected: One newline between the template and its signature image

Actual: Two newlines between the template and its signature image

Note: removing the newline from the end of the template doesn't fix the problem, it introduces another problem: image There doesn't seem to be a way to add a single newline at the end of the template.

Related tickets/Sentry events:

ghinda commented 2 years ago

Hi there,

I couldn't seem to be able to reproduce this issue. Adding a newline after the last line in the template moves the cursor to the next line when the templates is inserted - like in your expected result.

Could you please reach out on our support email address (support@briskine.com) with your more details (like your account email and the template with the issue)? We do have a post-template-save HTML parser that cleans up the HTML and handles newlines (like turning empty divs into brs), so there could be an edge case with your template's HTML.

ghinda commented 1 year ago

I think we finally caught this. It seems the extra newline was there only when inserting templates with the dialog, in a contenteditable. Fixed on the latest version 7.6.2.

DanKaplanSES commented 1 year ago

I am still experiencing this as described, and I am using 7.6.2 in firefox.

Here are my signature settings:

image

This is what it looks like when I create a new message (the red line indicates where I place my cursor):

image

I have a template f that looks like this (I highlighted the body to show that there is no newline at the end.):

image

If I type f, tab, it expands like this:

image

If I put a newline at the end of the template like so (oops, just noticed that "select all" doesn't select the newline. To prove a newline is there, I've captured my actual cursor in the screenshot):

image

And if I expand that template on a brand-new email body, it looks like this:

image

I can't find a way to have a single newline between the template and the signature.

I've done all the steps from scratch with a Gmail account that never had a signature before. I also tried doing this in a private tab where only Briskine, ublock origin, and Tampermonkey (with no active userscripts) were the only enabled extensions and it works the same way.

ghinda commented 1 year ago

Thanks for testing this, and the write-up. Can you please test inserting templates with the dialog - instead of shorcut+tab? You can open the dialog with ctrl+space by default.

Any chance you could also test this on Chrome?

DanKaplanSES commented 1 year ago

There was no difference when I used ctrl+space and left clicked the template.

There was no difference when I tried with chrome. I only tried t, tab though (t is the main template I use). Briskine wasn't installed on chrome, so I installed it to test it. I literally have no other extensions installed on Chrome but Briskine. I'm using windows 10.