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

[Solved] HMTL/Design view different within the same session/editor

1 Answer 175 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Alia
Top achievements
Rank 1
Alia asked on 12 Nov 2009, 04:45 PM
my thread from last week has disappeared... does anyone have any thoughts on these 2 issues?
(see attached for screenshots)

1. The same text copied from Word using the "paste from word" editor functionality is returning different HTML within the same browser/session/editor. Sometimes a line break is coming through as a <br /><br /> and sometimes as a <p></p>.

2. When I get the <p></p> tags - the Design view is rendering it differently when I toggle between design & HTML views.
  • First it shows it as 2 or 3 returns
  • Then after toggling to the HTML view and back it shows as no returns
  • Then after toggling to HTML and back it shows as 1 return.
  • Toggling back and forth from there it remains consistent.

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 17 Nov 2009, 01:20 PM
Hello Alia ,

The problem is really odd because the observed behavior can be reproduced if you paste content in IE and Firefox - the pasted content will be different, but it should not happen in the same browser.

Please paste the Word content by in an editable IFRAME element (test the attached html page) in Internet Explorer and Firefox and you will observe the identical result as in RadEditor. The content will be pasted with <P> tags in IE, and with <br> tags for new lines in Firefox. This is a browser behavior which is controlled by the browser and OS, but not by the IFRAME (the content area of RadEditor is also an editable IFRAME). You will experience the same issue with any DHTML editor, which content area is IFRAME / DIV element.

However, you noted that this problem happened only inside the same browser. Could you please open a support ticket and send the Word document and steps on how to reproduce the problem? Please, specify the browser under which this problem occurs.

As to the second issue: The observed behavior when toggling between Design and Html mode is due to the content optimization RemoveExtraBrakes filter of RadEditor which strips all extra brakes inside some tags like p, h1, etc.
To disable this behavior, please, put the following javascript code after the RadEditor declaration:
<telerik:radeditor runat="server" ID="RadEditor1"></telerik:radeditor>
<script type="text/javascript">
Telerik.Web.UI.Editor.RemoveExtraBrakes.prototype.getHtmlContent = function(content)
{
    return content;
}
Telerik.Web.UI.Editor.StripJunkFilter.prototype.getHtmlContent = function(content)
{
    return content;
}
</script>

The StripJunkFilter filter strips extra content, added by the Safari/Firefox browsers

Greetings,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Editor
Asked by
Alia
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or