2

When using Firefox for content authoring, when you paste a paragraph of content in your rich text field, it adds unwanted
tags at the end.

I can replicate this issue on the Vanilla instance of Sitecore Version 9.3 and Sitecore Version 10.

Steps to replicate:

  1. Open the Content editor
  2. Select default home page
  3. Select the Text field under Data and click Show editor. enter image description here
  4. Select the content and cut and paste the same (you will not few extra lines added at the bottom)
  5. Click Accept in Rich Text Editor
  6. Click Edit Html
  7. You can now see a new BR tag added <br class="t-last-br"/>

enter image description here

Does anyone know why this happens, it happens only in Firefox. We tried this in Version 9.3 and 10. This may be an issue in other versions too.

2

We experienced the same issue on a Sitecore 9.3 instance and fixed it adding the following code at the top of the \sitecore\shell\Controls\Rich Text Editor\RichText Commands.js file in our solution, as recommended by the Sitecore Support team:

function RadEditorCustomFilter() {
    RadEditorCustomFilter.initializeBase(this);
    this.set_isDom(false);
    this.set_enabled(true);
    this.set_name("RadEditor filter");
    this.set_description("RadEditor filter description");
}
RadEditorCustomFilter.prototype =
    {
        getHtmlContent: function (content) {
            if (Telerik.Web.Browser.ff) {
                content = content.replace('<br class="t-last-br" />\n', '');
            }
            return content;
        }
    }
RadEditorCustomFilter.registerClass('RadEditorCustomFilter', Telerik.Web.UI.Editor.Filter);
1
  • That worked @Alessandro Faniuolo. thanks for that – Mahesh Raghupathi Feb 5 at 2:08
0

I too had faced the similar issue and changing the "HtmlEditor.RemoveScripts" value to "false" fixed it for me. By default, the value for this setting is set to true. This setting is present in Sitecore.Config. The screenshot below for reference:

enter image description here

2
  • we have this value set to false already. let me check show config to make sure it is in effect. – Mahesh Raghupathi Feb 4 at 22:08
  • I can confirm that the setting is set to false, but the issue still exists – Mahesh Raghupathi Feb 4 at 22:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.