This is a migrated thread and some comments may be shown as answers.

Bug report ie8 pasting into editor

7 Answers 62 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jim
Top achievements
Rank 1
Jim asked on 17 Oct 2013, 12:38 PM
I am attaching an html file.  If you open this file in your browser,  and copy/paste into the demo application http://demos.kendoui.com/web/editor/index.html
it causes a javascript error. We are trying to use the editor in a production application, and are constrained to using ie 8.

Please advise.
Jim Meisterich

7 Answers, 1 is accepted

Sort by
0
Kiril Nikolov
Telerik team
answered on 21 Oct 2013, 08:36 AM
Hello Jim,

I have tested the paste function inside the Kendo UI Editor running on IE8 and did not observe any discrepancies in the way it is working. As for attached file - I was not able to find it in the ticket. 

If the problem still persists, please extract a runnable sample in a jsBin/jsFiddle that we can investigate locally and narrow down the problem.
 
Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jim
Top achievements
Rank 1
answered on 21 Oct 2013, 06:21 PM
The problem does still exist, and I believe it is caused by the content of the html file, since it fires the js error when I paste the html into your demo application.
if you create an html file using the markup below, and open that file in your browser, and copy and paste into the demo application, you should be able to see the javascript error.

Thanks in advance for your help,
Jim

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
</head>
<body>
    <FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>
<P>function</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> EditorPaste(ev) {</P>
<P></FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>debugger</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>;</P>
<P></P>
<P></P>
<P></FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>var</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> editor = $(ev.sender.element).data(</FONT></FONT><FONT color=#800000 size=2 face=Consolas><FONT color=#800000 size=2 face=Consolas><FONT color=#800000 size=2 face=Consolas>"kendoEditor"</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>);</P>
<P></FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>var</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> $content = $(</FONT></FONT><FONT color=#800000 size=2 face=Consolas><FONT color=#800000 size=2 face=Consolas><FONT color=#800000 size=2 face=Consolas>'&lt;span&gt;'</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> + ev.html + </FONT></FONT><FONT color=#800000 size=2 face=Consolas><FONT color=#800000 size=2 face=Consolas><FONT color=#800000 size=2 face=Consolas>'&lt;/span&gt;'</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>);</P>
<P>$content.find(</FONT></FONT><FONT color=#800000 size=2 face=Consolas><FONT color=#800000 size=2 face=Consolas><FONT color=#800000 size=2 face=Consolas>'*'</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>).removeAttr(</FONT></FONT><FONT color=#800000 size=2 face=Consolas><FONT color=#800000 size=2 face=Consolas><FONT color=#800000 size=2 face=Consolas>"style"</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>);</P>
<P>ev.html = $content.html();</P>
<P></FONT></FONT><FONT color=#006400 size=2 face=Consolas><FONT color=#006400 size=2 face=Consolas><FONT color=#006400 size=2 face=Consolas>// editor.paste(ev.html);</P></FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>
<P>$content.remove(); </P>
<P></P>
<P>$(ev.sender.document.body).click(); </P>
<P></P>
<P>}</P></FONT></FONT>
</body>
</html>
0
Kiril Nikolov
Telerik team
answered on 23 Oct 2013, 08:18 AM
Hello Jim,

I have manged to reproduce the problem you are describing. And it comes from the fact that you are pasting an invalid html inside the editor, so it is not possible for it to correctly display the markup. If valid html is pasted inside the editor, it works as expected.
 
Regards,
Kiril Nikolov
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jim
Top achievements
Rank 1
answered on 23 Oct 2013, 11:21 AM
How is the html invalid?  the html I provided displays correctly in ie8.  Also it was copied (as text) directly from the visual studio editor, and pasted into the kendo editor.  We are also having a problem with some text pasted from outlook.  Our users don't control the html that outlook creates, so telling them it's invalid html won't work for us.  



0
Alex Gyoshev
Telerik team
answered on 24 Oct 2013, 08:20 AM
Hello Jim,

We will explore some options about converting the HTML to a valid state (it is invalid in terms of improperly closed tags, which are reported as such by IE8 and break the processing of pasted content). I will follow up with our findings.

Regards,
Alex Gyoshev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Alex Gyoshev
Telerik team
answered on 25 Oct 2013, 10:35 AM
Hello Jim,

I am glad to inform you that we have managed to pre-process the invalid markup so that it behaves properly in browsers that do not do this automatically. The bug fix will be included in the next internal build, which should be published at the beginning of next week. Please note that the end-result differs slightly in some scenarios, but the editor remains functional (in the example that you posted, the first keyword ("function") is styled by improper nesting of the font tag, which is not handled by the HTML parser).

Regards,
Alex Gyoshev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Jim
Top achievements
Rank 1
answered on 25 Oct 2013, 01:12 PM
That's great news Alex!!!

I really appreciate your help.

regards,
Jim
Tags
Editor
Asked by
Jim
Top achievements
Rank 1
Answers by
Kiril Nikolov
Telerik team
Jim
Top achievements
Rank 1
Alex Gyoshev
Telerik team
Share this question
or