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

[Solved] Avoid removal of HTML comments

1 Answer 89 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Peter Dzugas
Top achievements
Rank 1
Peter Dzugas asked on 12 Aug 2009, 11:53 AM
Hello,

In my HTML page there are used special comment-like blocks which are necessary for proper rendering in various browsers.
The part of the content is like this:
 <!--[if lte IE 7]> 
        <ul style="display: inline"
 <![endif]-->  
 <![if !IE]> 
        <ul> 
 <![endif]> 
 
I have disabled all filters in RadEditor ContentFilters="None".
When I load such page in RadEditor running on Firerfox then everything is fine and I can edit the contents without problems.
However, when I launch the same application in IE, the part with non-IE specific block
 <![if !IE]> 
        <ul> 
 <![endif]> 
is completely removed by the editor thus effectively destroying my layout because <ul> opening tag will be missing.
Is it possible to avoid this behaviour i.e. keep HTML markup untouched upon loading the contents of editor from external file?
Please do not advice to move my inline style attribute to external CSS file. I've tried this approach and it didn't work. This coding is the only way how to achieve that my page layout is consistent across different browsers.

Thanks in advance for your reply!

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 17 Aug 2009, 07:49 AM
Hi Peter,

The content area of RadEditor is editable IFRAME which uses the underlining Rich Text Editing engine of the browser where it operates. The reported behavior is IE related, it does not exist in Firefox and can be reproduced in editable <iframe>, <div> elements and in our competitors' editors too.

What you can do is to set the ContentFilters property to "None". After that create an external css file with the following content:

*+html UL, *html UL 
    display:inline

and load the css file through the CssFiles property of RadEditor:

<telerik:radeditor runat="server" ID="RadEditor1"
    <CssFiles> 
        <telerik:EditorCssFile Value="~/ContentArea.css" /> 
    </CssFiles> 
</telerik:radeditor>   

You wrote that you have tried to move your inline style attribute to external CSS file, but that it didn't work. Could you please tell us what exactly you have tried and provide an example?

Best regards,
Rumen
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
Peter Dzugas
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or