Skip to content
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

Paragraph formatting and big line spacing in word processor programs leads to an additional empty line when WritingTools pastes the text back. #114

Open
Ulf3000 opened this issue Jan 31, 2025 · 7 comments

Comments

@Ulf3000
Copy link

Ulf3000 commented Jan 31, 2025

what the title says.
Newest Thunderbird.

@theJayTea
Copy link
Owner

Hello! Does this happen only in Thunderbird with the same text?

Rarely, some models decide to add line spacing.
A different model might preserve it much more often, and in the coming update, you'll be able to change the system prompt (so you could specific no line spacing changes since you never want it).

@momokrono
Copy link
Collaborator

Hi!

Could you tell us some more details? Like, type of OS, version of it and so on?

As @theJayTea said, the app only applies what the model writes, and if the model has been trained on thinking that the most "correct" way of writing is by adding those extra lines when detecting the input is an email, it outputs the reformatted text and WritingTools dumps the new content on screen. You could try opening a text editor, write a fake email and let the model rewrite it.
If no new lines are added this could be something related to Thunderbird, since and <shift+enter> give you two different spacing: the former being bigger, since it's a new paragraph, the latter being smaller since it's a new line inside the same paragraph. You could try copy-pasting some text with empty lines from, I don't know, Word to Thunderbird and see if the behavior is the same.

@Ulf3000
Copy link
Author

Ulf3000 commented Feb 1, 2025

I'm going to check it later in detail; maybe it has to do with a big line spacing in my email document.

Is Gemini aware of text settings?

@momokrono
Copy link
Collaborator

If by "text settings" you mean "application-side text settings" (i.e. font size, line spacing and so on) no, gemini is simply instructed to review the text you selected and rewrite it without commenting on it and has no awareness whatsoever of the application the text is coming from.

With the next release you'll be able to customize the instructions for the LLMs, for example you'll be able to create a new option specifically for reviewing emails. Something like "You are an email proofreader assistant. Rewrite the email provided by the user without ever commenting on it, just focus on correcting mistakes or improving it. Avoid new lines whenever possible. Etc."

@Ulf3000
Copy link
Author

Ulf3000 commented Feb 3, 2025

Okay, update: It is definitely the text format settings.

If my Text is set to Paragraph in Thunderbird, it has a big line spacing, and it will be pasted back with an additional empty line.

This can be reproduced in OpenOffice Writer and Affinity Publisher too.
(Other word processors too, probably.)

When Windows copies Text, it will copy two different versions of it. One which is meant to paste text with formatting to other apps which support it, and one raw text which can be viewed when pasting to a text file, for example, and then also converts text set as paragraph, and bigger line spacing into blank lines.

That's a bit inconvenient when using your tool from text processor apps with text formatting. Maybe you could read the other version and extract the text from there before sending to the ai.

Edit: I will edit the title accordingly

@Ulf3000 Ulf3000 changed the title In Thunderbrid it will add empty lines between the Textlines on rewrite. Paragraph formatting and big line spacing in word processor programs leads to an additional empty line when WritingTools pastes the text back. Feb 3, 2025
@theJayTea
Copy link
Owner

@Ulf3000 , yep, Writing Tools only sends and receives plaintext from the LLM.
The issue is that the LLM can only interface in plaintext.

I've considered parsing the rich text into Markdown formatting before sending it to the LLM, but the issue is that Markdown supports only a small subset of rich text - for instance, you can't underline, change text colour, highlight, specify precise paragraph spacing, etc.

Let me know if you have any other ideas!

@Ulf3000
Copy link
Author

Ulf3000 commented Feb 3, 2025

isnt there a good library which can at least parse richtext to plain text better and more intelligent than microsofts implementation ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants