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

[Solved] same text, same editor, different html & different spacing

1 Answer 107 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Alia
Top achievements
Rank 1
Alia asked on 05 Nov 2009, 08:06 PM
I'm using the "Paste from word" function and am running into a couple of issues. (see attached for screenshots)

1. sometimes the same line with a soft return in Word is generating an <p></p> in the editor HTML and sometimes it's a <br /><br />. I've copied and pasted from Word from the same clipboard instance, in the same editor within the same session and seen different results.

2. when I do get the <p></p> tags... sometimes that is rendered in the design view as no returns, one return, two returns or three returns. Togelling back and forth between design and HTML changes it until it settles at the one return and then it seems to hold consistently.

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 10 Nov 2009, 03:48 PM
Hi Alia,

Straight to the points:
1) RadEditor does not modify the pasted content - it is MS Word and the browser that convert the Word content to HTML / XML content when it is pasted in RadEditor. The content area of RadEditor is editable IFRAME so you should experience the same behavior with an editable IFRAME or our competitors' editors.

2) The observed behavior when toggling between Design and Html mode is due to the content optimization RemoveExtraBrakes filter of RadEditor which strips all extra brakse 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>

Kind regards,
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