Opened 13 years ago

Last modified 9 years ago

#6161 closed defect

Paste error in Editor — at Version 1

Reported by: guest Owned by: liucougar
Priority: high Milestone: 1.7
Component: Editor Version: 1.0
Keywords: Cc:
Blocked By: Blocking:

Description (last modified by bill)

I have run into a difficult issue with the Editor control in IE7 and dojo 1.0.2. A simple copy/paste operation causes the Editor.getValue() to be invalid HTML. To reproduce the error:

  1. Start with an empty Editor control.
  2. Type a, hit enter, type b, hit enter.
  3. Highlight the a and make it bold (or any other markup).
  4. Highlight the enter line the b is on (so you get the newline).
  5. Paste next to the a.

The result is arguably incorrect as you now have a bold a, bold b and regular b (each on their own line) when one would expect two regular b's. The exact spacing (two lines, three lines, etc) is debatable and completely irrelevant. The real problem, however, is the markup that is returned from getValue() is invalid. It is as follows:

< p >< strong >a< p >b< /p >< /strong >< /p >< p >b< /p >< p >b< /p >

If you put it back into the control (ie if the markup is saved like this), it will get progressively worse each time as more and more b's are added. Any help in resolving this issue would be greatly appreciated.

Note: You can accomplish the same incorrect markup just by adding newlines but the repro steps are easier here.

Change History (1)

comment:1 Changed 13 years ago by bill

Description: modified (diff)

I assume step #4 you need to do a copy?

Note: See TracTickets for help on using tickets.