Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1375645 - Evolution is inserting Non-breaking space instead of Space at the start of lines even with "Preformatted" set
Summary: Evolution is inserting Non-breaking space instead of Space at the start of li...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: evolution
Version: 24
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
Assignee: Milan Crha
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-13 15:10 UTC by Harshula Jayasuriya
Modified: 2017-08-08 17:20 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-08 17:20:07 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Harshula Jayasuriya 2016-09-13 15:10:54 UTC
Description of problem:

Evolution appears to be substituting the Spaces in copied text with Non-breaking spaces even when the text is highlighted and "Preformatted" is set.

This behaviour is particularly problematic when emailing patches to RHKL.

Version-Release number of selected component (if applicable):

* evolution-3.20.5-1.fc24.x86_64

How reproducible:

* Always

Steps to Reproduce:
1. Create a patch using git format-patch -1
2. Open the patch file in gvim
3. Copy and paste the text into Evolution "Compose Message" window.
4. Highlight the text in the "Compose Message" window and set the text to "Preformatted"
5. Send the email to yourself.
6. Once email is received, "Save as mbox...".
7. Inspect the file with a hex editor.

Actual results:

Non-breaking spaces appear at the start of lines.

Expected results:

Spaces appear at the start of the lines.

Comment 1 Milan Crha 2016-09-14 10:19:56 UTC
Thanks for a bug report. I'm only wondering, is the composer in the Plain text mode, or in the HTML mode?

Comment 2 Harshula Jayasuriya 2016-09-15 12:54:57 UTC
No probs. Plain text mode.

BTW, one workaround is to create a "New" email and immediately set it to "Preformatted" and then paste the patch into it.

Comment 3 Tomas Popela 2016-09-15 13:11:16 UTC
(In reply to Harshula Jayasuriya from comment #0)
> 3. Copy and paste the text into Evolution "Compose Message" window.
> 4. Highlight the text in the "Compose Message" window and set the text to
> "Preformatted"

As you wrote it in the comment #6 to let it work correctly you have to change the format of the block to "Preformatted" before you paste to it. Otherwise the whitespaces will be indeed replaced to non-breaking spaces (as otherwise the spaces would collapse) and when you later switch from "Normal" to "Preformatted" the spaces are not replaced back (as we don't know which spaces were replaced to non-breaking ones - we have to somehow remember that, but it is not that easy).

Comment 4 Harshula Jayasuriya 2016-09-16 10:08:18 UTC
IIRC, when replying to an email and pasting a patch, there was no way to avoid NBSPs. Do you have a workaround when replying to emails?

Comment 5 Tomas Popela 2016-09-16 11:20:54 UTC
(In reply to Harshula Jayasuriya from comment #4)
> IIRC, when replying to an email and pasting a patch, there was no way to
> avoid NBSPs. Do you have a workaround when replying to emails?

No it behaves the same even for the replies (it shares the same code). Please try this (I tried it on 3.20.5):

1) Reply to some plain text mail
2) Go on the first line on the mail, press the Return key, this will create a new block. Make sure that the block is set to "Preformatted"
3) Open gedit and copy&paste the following there:
no space before
 one space before
      more spaces before
<replace this with tabulator>tabulator before
nothing before

4) Copy this and paste it to the block that you've created in step 2
5) Press Ctrl + Shift + i to open the WebKit Inspector
6) Paste the following to the console and compare the expected results

command: document.body.firstChild.innerHTML
expected: "no space before"

command: document.body.firstChild.nextSibling.innerHTML
expected: " one space before"

command: document.body.firstChild.nextSibling.nextSibling.innerHTML
expected: "      more spaces before"

command: document.body.firstChild.nextSibling.nextSibling.nextSibling.innerHTML
expected: "<span class="Apple-tab-span" style="white-space:pre">	</span>tabulator before"

command: document.body.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.innerHTML
expected: "nothing before"

If you would set the block format in step 2 to the "Normal" you would see the following:

command: document.body.firstChild.innerHTML
expected: "no space before"

command: document.body.firstChild.nextSibling.innerHTML
expected: "&nbsp;one space before"

command: document.body.firstChild.nextSibling.nextSibling.innerHTML
expected: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;more spaces before"

command: document.body.firstChild.nextSibling.nextSibling.nextSibling.innerHTML
expected: "<span class="Apple-tab-span" style="white-space:pre">	</span>tabulator before"

command: document.body.firstChild.nextSibling.nextSibling.nextSibling.nextSibling.innerHTML
expected: "nothing before"

Does it provide the same output for you?

Comment 6 Harshula Jayasuriya 2016-10-09 13:07:55 UTC
Hi Tomas, Apologies for the delay, I was on leave.

a) I used some of the steps you suggested and found that I *can* reply to an email and insert preformatted text by doing the following:

1. Create a patch using git format-patch -1
2. Open the patch file in gvim
3. Reply to an email, press enter two times at the top.
4. Set the first empty line to "Preformatted".
5. Copy and paste the text into Evolution "Compose Message" window at the first empty line.
6. Send the email to yourself.
7. Once email is received, "Save as mbox...".
8. Inspect the file with a hex editor.

b) Considering what has been documented in this BZ, perhaps it would be best to *disallow* highlighting existing text and setting it to preformatted until this NBSP issue is resolved? When was substituting spaces with NBSPs introduced into Evolution?

Comment 7 Fedora End Of Life 2017-07-25 23:00:58 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 8 Fedora End Of Life 2017-08-08 17:20:07 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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