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

[Solved] XHTML and RGB

2 Answers 107 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Philippe GRACA
Top achievements
Rank 1
Philippe GRACA asked on 31 Mar 2009, 04:00 PM
Hi all
I've read in a post (http://www.telerik.com/community/forums/aspnet-ajax/editor/editor-changes-content-on-its-own.aspx) the following

We just made some additional improvements to the filters mechanism - you might have noticed that in FF the browser automatically converts colors in style tags from "#XXXXXX" syntax to "rgb(xx,xx,xx)". We have extended the ConvertToXhtml filter to run a regular expression to convert those colors back to the more traditional format.

This is causing us an issue because the content that is being sometimes entered with Copy/Paster in the editor HTML area and we must keep the initial rgb(xx,xx,xx) formats to avoid this.
Of course, we must keep the XHTML compliance ;)

Any ideas?
Regards
Philippe

2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 03 Apr 2009, 01:16 PM
Hi Philippe,

You can disable this feature of the ConvertToXhtml filter by adding the following javascript under the RadEditor's declaration:

<telerik:RadEditor runat="server" ID="RadEditor1" ExternalDialogsPath="~/EditorDialogs">
    <FlashManager ViewPaths="~/Images" UploadPaths="~/Images" />
</telerik:RadEditor> 
<script type="text/javascript">
Telerik.Web.UI.Editor.ConvertToXhtmlFilter.prototype._convertRgbToHex = function(text)
{   
    return text;
}
</script>


Thus the editor will stop the conversion of RGB colors to #XXXXXX colors in Firefox.

Greetings,
Rumen
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Philippe GRACA
Top achievements
Rank 1
answered on 03 Apr 2009, 01:19 PM
Thx a lot!
This RadEditor rocks :)
Tags
Editor
Asked by
Philippe GRACA
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Philippe GRACA
Top achievements
Rank 1
Share this question
or