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

Newlines add an extra whitespace #275

Closed martinlatrille closed 3 years ago

martinlatrille commented 6 years ago

When adding a blank line in a template, there's a whitespace added in the blank lines when using the templates.

foo

bar

becomes:

foo
[space]
bar

https://gorgias.gorgias.io/app/ticket/7604304

mondalaci commented 5 years ago

This is actually quite frustrating. I have a template which contains:

Hi {{to.first_name}},
[enter]
[enter]

I'd like to use this template whenever I answer the first email in a Gmail thread, but this is what gets inserted:

Hi {{to.first_name}},
[enter][space]
[enter][space][this is the current cursor position]

So every time after I type h[tab], I need to hit an extra backspace.

ghinda commented 5 years ago

The current workaround is to use soft returns (Shift + Enter), instead of regular ones, when adding newlines in the editor. This prevents the extra whitespace from being added.

You'll have to update your existing templates to change the newlines where you don't want the whitespace to be added.

We're still looking for a permanent fix for this issue.

mondalaci commented 5 years ago

Thanks so much! This looks like a viable workaround.

ghinda commented 3 years ago

Now fixed in the latest version of the editor in the dashboard. The editor will now use <br> instead of <div>&nbsp;</div>, so empty newlines will not contain any whitespace.

This only applies to templates created or edited from now on. Previously created templates are not affected. Please note, the previous Shift + Enter workaround will not work anymore. In fact, using it will render newlines containing whitespace <div>&nbsp;</div>.