Approved
Last Updated: 27 Feb 2019 14:05 by ADMIN
Brian
Created on: 27 Feb 2019 13:53
Category: Editor
Type: Bug Report
1
Editor does not convert rgb to hex in MS Edge when converting from <font> to <span>

Reproduction steps: 

<telerik:RadEditor runat="server" ID="RadEditor1">
     <Content>
        <span style="color: #548dd4;">asdas</span>this is sample text
     </Content>
</telerik:RadEditor>

When the mode is changed to HTML, the content is as follows: 

Expected: 

<span style="color: #548dd4;">asdas</span>this is sample text

Actual: 

<span style="color: rgb(84, 141, 212);">asdas</span>this is sample text

 

1 comment
ADMIN
Peter Milchev
Posted on: 27 Feb 2019 14:05
Hello Brian,

The following script can be added for a temporary workaround: 

<script>
    Telerik.Web.UI.Editor.ConvertToXhtmlFilter.prototype._convertRgbToHex = function (text) {
        if ($telerik.isFirefox || $telerik.isSafari || $telerik.isIE9Mode
            || Telerik.Web.Browser.chrome || Telerik.Web.Browser.edge) {
            text = text.replace(/rgb *\( *\d+ *, *\d+ *, *\d+ *\)/gi, function (match, offset, fullText) {
                return Telerik.Web.UI.Editor.Utils._rgbToHex(match);
            });
        }
        return text;
    }
</script>


Regards,
Peter Milchev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.