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

[Solved] radEditor glitches!

1 Answer 127 Views
Editor
This is a migrated thread and some comments may be shown as answers.
hstabbal
Top achievements
Rank 1
hstabbal asked on 22 Nov 2009, 08:47 AM
Hello,
I am currently evaluating Telerik controls (the latest Q3 release) to see if they fit in my current project and I was amazed with the tools and controls that you empower developers with. I was comparing Telerik radEditor to FCKeditor which is currently used in our project.
I noticed the following things which I don't know how to handle:
The majority of documents that our users work with are in Arabic and some times there might be both Arabic and English paragraphs in the same document. The documents are lengthy and include all sorts of things like annotations, Table of Contents, ...etc.

1- When I use the paste from word option (in radEditor), the output is not as clean as the one generated by FCKeditor, even when using the MSWordRemoveAll option. For example, I find tags like :

<p style="text-justify: kashida; text-align: justify; text-kashida: 0%; unicode-bidi: embed; direction: rtl; background: white;" dir="rtl"><b></b></p>
<p style="text-align: center; margin: 0in 0in 0pt; background: white;" dir="rtl">&nbsp;</p>

while, in FCKeditor, the output will be :

<div dir="rtl">
    <b>&nbsp;</b></div>
<div dir="rtl">
    <b>&nbsp;</b></div>

Is there a way to strip all the styling information coming from word? I thought about re-defining the function that strips word documents to include more rules but I don't know if this is possible or not! (I looked at the radeditor JS code and the file is minified but I was able to identify the place where word stripping occurs, is there a way to redefine the function without directly editing this file?)

Furthermore, radEditor includes some strange style attributes  markup when used in Mozilla firefox (FCKeditor includes some regex expressions to remove this markup) like :

<p style="background: white none repeat scroll 0% 0%; text-align: justify; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; direction: rtl; unicode-bidi: embed;" dir="RTL"><strong></strong></p>

Is there  a way to fix this?

2- Currently there is no direct,easy way to include both rtl and ltr content in the same edited document. I read the post that suggests adding two buttons to radEditor to switch between rtl and ltr but ,it's only a guess (I didn't test it) , I am afraid that it will affect the whole document not the selection because it didn't seem to me that it's surrounding the selection with markup to indicate the new direction. Is there a turn around?

I am still evaluating the editor, so I don't know if I will find any additional things, but till now, I am impressed and I guess that having the above points in place will be a great addition to radEditor.






1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 25 Nov 2009, 04:30 PM
Hi,

Thank you for your nice words about RadEditor. We will be glad to welcome you as a customer.

Straight to the questions:
1) The following articles could be helpful for your scenario:
Stripping inline styles when using the Paste from Word button
and
OnClientPasteHtml event.
In the OnClientPasteHtml event you receive the pasted content as a string and using regular expressions you can strip all unwanted tags and css attributes.

2) For the time being RadEditor does not offer built-in RTL and LTR buttons and they are not planned for implementation for the upcoming Q1 2010. The only available example that works in most scenarios is provided in this forum thread: http://www.telerik.com/community/forums/aspnet-ajax/editor/rtl-amp-ltr-buttons-in-the-radeditor-tools.aspx

You can try to customize the code to better fit your scenario.

Sincerely,
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
hstabbal
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or