Author Topic: Copy & Paste Bug: Spaces get transformed to <nbsp>  (Read 1011 times)

Offline knn

  • Newbie
  • *
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Copy & Paste Bug: Spaces get transformed to <nbsp>
« on: July 30, 2010, 12:30:22 pm »
When I mark some text and then paste it into a html editor (Frontpage, Wordpress etc) then all <spaces> got converted to <nbsp;> and thus a whole pasted text would turn into a nobreak-line.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1670
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Copy & Paste Bug: Spaces get transformed to <nbsp>
« Reply #1 on: July 30, 2010, 12:59:08 pm »
This is not the bug. It is by design. Otherwise browser will merge all spaces and eat indent. As far as I remember. 
HippoEDIT provides different clipboard formats by request. If application wants HTML - it gets HTML (syntax highlighted), if RTF -> RTF (syntax highlighted), if Plain text -> text without syntax highlighting and with normal spaces.
If your paste it in design mode, this is as it should be. If you paste it in source view mode, this is a bug of the html editor, because they need to request text but not html.

Offline knn

  • Newbie
  • *
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: Copy & Paste Bug: Spaces get transformed to <nbsp>
« Reply #2 on: July 30, 2010, 04:17:06 pm »
Sorry, when I paste text from a TEXT EDITOR then unformatted text should be pasted.

There is absolutely no reason to convert all spaces " " to &nbsp;. There is no sense in it.

This is definitely a major no-no and renders HippoEdit useless for me.

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1670
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Copy & Paste Bug: Spaces get transformed to <nbsp>
« Reply #3 on: July 30, 2010, 09:13:23 pm »
Sorry, I think you are not aware about different clipboard formats.
Try to paste text from HippoEDIT to Windows Notepad. If you will get <nbsp;> pasted, I will change it.

Nobody force you to use HE. Use that editor you like. And I am as author, will do what I think is right. You can try to convince me, but decision will be done on my side.

Offline knn

  • Newbie
  • *
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: Copy & Paste Bug: Spaces get transformed to <nbsp>
« Reply #4 on: July 31, 2010, 06:21:23 am »
Sorry, I think you are not aware about different clipboard formats.
Try to paste text from HippoEDIT to Windows Notepad. If you will get <nbsp;> pasted, I will change it.

Nobody force you to use HE. Use that editor you like. And I am as author, will do what I think is right. You can try to convince me, but decision will be done on my side.

Can you tell me 1 other TEXTeditor that inserts converted text (text --> html) when I paste?
Such a conversion is unheard of. One of the _MAIN_ reasons to use text editors is that there is no formatting, just the pure text-chars.

But what you implemented is triple-bad:
1) Pasting becomes unreliable since what you copied is not what you pasted
2) Pasted text gets converted into something that makes no sense (space is not equivalent to nobreak-space. If you want to introduce nobreaks then correct approach would rather be to surround by <nobr> tags)
3) And SOMETIMES HippoEdit does INDEED paste only the text without any conversions.

So if you want to keep this WYSIWYG behavior then please make it optional (e.g. right-click -> "rich copy"). Sorry, but this is a killer bug for me. It would be a pity if Hippoedit (= maybe the best texteditor out there) would become grossly unusable because of this.
« Last Edit: August 01, 2010, 05:12:01 am by knn »

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1670
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Copy & Paste Bug: Spaces get transformed to <nbsp>
« Reply #5 on: August 01, 2010, 09:16:58 pm »
Sorry once more. But probably you really do not understand. I have also provided an example with Windows Notepad, but you have not taken it into account.

HippoEDIT provides that format which target application requests.
If FrontPage or what ever will request TEXT it will get plain text, without any formating as you have in HippoEDIT.
But it request HTML clipboard format and gets it.
So if you complain about passed HTML text, this is not to HippoEDIT but to other App. On HippoEDIT side everything is correct.

Just want to clarify why at all necessary to support these clipboard formats (HTML and RTF) for text editor with syntax highlighting.
This is only a way to transparently pass syntax highlighting information to another application to allow them display this text WYSIWYG. For example to paste syntax highlighted source code into mail with MS Outlook or into Word document for spec etc.

« Last Edit: August 02, 2010, 12:10:41 am by alex »

Offline knn

  • Newbie
  • *
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: Copy & Paste Bug: Spaces get transformed to <nbsp>
« Reply #6 on: August 10, 2010, 11:57:34 am »
Sorry once more. But probably you really do not understand. I have also provided an example with Windows Notepad, but you have not taken it into account.

HippoEDIT provides that format which target application requests.
If FrontPage or what ever will request TEXT it will get plain text, without any formating as you have in HippoEDIT.
But it request HTML clipboard format and gets it.
So if you complain about passed HTML text, this is not to HippoEDIT but to other App. On HippoEDIT side everything is correct.

I fully understand. Hippoedit does what it is programmed to do.

The problem is that Hippoedit is a text editor and thus should deal with text not with WYSIWYG.

If you want Hippoedit to copy formatted text then please do so but make it OPTIONAL (e.g. rightclick->rich copy).

As it stands now Hippoedit is nearly utterly useless for me. As it stands now I am forced to copy&paste SIMPLE TEXT from HippoEdit to some third party text editor and then copy&paste it from this other editor to the WYSIWYG editor just because of the nonsense conversion of <space> to &nbsp;

Sorry, but what you demand is to
  • switch into "Text Mode" of, letsay, the WordPress-Editor (or FrontPage Editor)
  • wait until Wordpress reloads the page in TextMode
  • let WordPress possibly mess around with HTML code
  • make me scroll down to the place where I want to paste the text
  • wait until WordPress (or Frontpage) switches back to WYSIWYG mode again
  • make me scroll down to the place where I need to continue editing

just for the extreme rare case that someone wants to keep HippoEdit syntax hilighting.

I doubt it that you will find any other text editor doing this ridiculous conversion.

It's completely IRRELEVANT what the receiving WYSIWYG editor (e.g. Frontpage or Wordpress) requests: A WYSIWYG editor will ALWAYS accept WYSIWYG-marked clipboard content (except in special modes).

Look, I am a programmer myself and as far as I am concerned HippoEdit is a masterpiece of coding (and especially since it came so suddenly out of nowhere) and I admit that having this clipboard-format-on-demand feature adds to HippoEdit's huge arsenal. But at the end of the day HippoEdit is a text editor thus it should default like one. So please reconsider.
« Last Edit: August 10, 2010, 12:37:12 pm by knn »

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1670
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Copy & Paste Bug: Spaces get transformed to <nbsp>
« Reply #7 on: August 10, 2010, 06:01:43 pm »
Quote
I doubt it that you will find any other text editor doing this ridiculous conversion.
Microsoft Visual Studio.

Quote
Sorry, but what you demand is to
switch into "Text Mode" of, letsay, the WordPress-Editor (or FrontPage Editor)
wait until Wordpress reloads the page in TextMode
let WordPress possibly mess around with HTML code
make me scroll down to the place where I want to paste the text
wait until WordPress (or Frontpage) switches back to WYSIWYG mode again
make me scroll down to the place where I need to continue editing
So, all programs work correctly. But you not:
- You actually paste in the FrontPage or WordPress-editor in WYSIWIG mode
- This is a reason why other app request from HE HTML format. Because you are in WYSIWIG mode, they request WYSIWIG text
- HE does not copy something to clipboard, it only informed other apps which clipboard formats it supports
- Other app selects that format, from within proposed by HE, which it likes more and picks it up

So, you have a way to get text in plain mode, if you process in designed way, but you complain that it is too much movements for you.

Ok. At the end. This is not a bug. I can accept it as a dev request and maybe will add the xml flag to disable HTML Clipboard format.
But only in 1.50 or later and only after all other features. If you want to have this feature earlier you can pay for custom development request.
« Last Edit: August 11, 2010, 01:29:38 pm by alex »

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 773
  • Karma: +6/-0
    • View Profile
Re: Copy & Paste Bug: Spaces get transformed to <nbsp>
« Reply #8 on: August 10, 2010, 07:52:53 pm »
AH, now i get it. HippoEDIT can not only get several formats from clipboard
but also provides several formats to the clipboard. HEUREKA, i was not aware of this.

HippoEDIT can choose which format to paste from clipboard, i guess other apps are able to do the same.
I see this e.g. in WORDTM and Lotus NotesTM f.ex., there are menu commands to do so.
At default such apps take from clipboard what is the default for that app.




Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1670
  • Karma: +29/-2
    • View Profile
    • HippoEDIT
Re: Copy & Paste Bug: Spaces get transformed to <nbsp>
« Reply #9 on: August 11, 2010, 01:30:44 pm »
Thanks Stefan ;)

Offline knn

  • Newbie
  • *
  • Posts: 45
  • Karma: +0/-0
    • View Profile
Re: Copy & Paste Bug: Spaces get transformed to <nbsp>
« Reply #10 on: August 11, 2010, 07:35:40 pm »
AH, now i get it. HippoEDIT can not only get several formats from clipboard
but also provides several formats to the clipboard.
Exactly.

Thus in practice HippoEdit will ALWAYS paste WYSIWYG texts into WYSIWYG-editors (e.g. Word, Wordpress, Frontpage) since all WYSIWYG-editors accept WYSIWYG text.

Thus in practice I need a third party text editor to get rid of WYSIWYG formatting (= formatting that HippoEdit itself inserted into the text).

 

Related Topics

  Subject / Started by Replies Last post
6 Replies
1087 Views
Last post December 04, 2008, 04:06:38 pm
by alex
1 Replies
343 Views
Last post May 17, 2009, 06:38:55 pm
by alex
2 Replies
704 Views
Last post May 23, 2009, 07:59:54 pm
by Stefan
1 Replies
372 Views
Last post June 20, 2009, 01:19:11 pm
by alex
0 Replies
164 Views
Last post March 17, 2011, 08:10:20 pm
by Stefan