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

[Solved] Editor: cross browser support question

1 Answer 79 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Jc
Top achievements
Rank 1
Jc asked on 07 Aug 2009, 11:12 AM
We are looking for an editor which can apply CSS styles to text and produce consistent visual and html results on all major browsers.

Trying a simple test, I get different results. Can you explain?

Here's the test:

We go to the your demo: http://demos.telerik.com/aspnet-ajax/editor/examples/default/defaultcs.aspx
1. click in the main paragraph
2. ctrl-a to select all
3. hit delete
4. type hello
5. double click hello to select it
6. apply css class ‘red text’ from the drop-down

Result:
IE: text turns red, and the html reads: <p class="redText">hello</p>
Chrome: text stays black, html: <span>hello</span>
Safari: text turns red, html: <span class="redText">hello</span>
Firefox: text turns red, html: <span class="redText">hello</span><br />

Is there something that we are missing or will different browsers always produce unpredictable html?

Thanks!

Jc

1 Answer, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 12 Aug 2009, 08:58 AM
Hi Jc,

Certainly, while there are huge differences across browsers and even browser versions, the essence of RadEditor is to hide this from the users, correct the various differences and produce similar/the same HTML for all supported platforms. This has never been an easy task, especially with new browsers, such as Chrome. This is ongoing work and each editor version adds more functionality in this direction.

Here is some feedback on the test you performed:

1. Chrome - there is a problem with the editor in Chrome which prevents it from applying the className properly. We are aware of it and the issue will be resolved in the coming Q1 2009 SP1 to be released later this month. So, soon you will get the following result:
<span class="redText">hello</span>

2. FireFox - The issue with browser-inserted <br/> tag at the end of the content is already addressed in the current internal builds. Hence, when SP1 is released, the content in FireFox will also be:
<span class="redText">hello</span>

As a result all browsers except IE will produce the same end result.
Now, what about IE?
Well, the "problem" is that, unlike other browsers IE always inserts an empty paragraph tag - which is where you start typing your content. Since you only type a single word - when you select it, in fact the whole paragraph is selected and the ApplyClass command would apply it on the P tag. However, if you wrote a couple of extra words, e.g Hello hello hello - and you selected some of the content you would end up with the same behavior like in the other browsers.

Best regards,
Tervel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Jc
Top achievements
Rank 1
Answers by
Tervel
Telerik team
Share this question
or