We have been trying to extend the Rich Text Editor built into Sitecore 9, but have encountered a problem with the pasteHtml method. Trying to insert this snippet:
Is there anything that can be done to fix this behaviour?
5 Answers, 1 is accepted
I tried to reproduce the reported issue with default configuration of the latest version of the control, but without success.
You can see my test in the attached video recorded in Edge, Chrome and Firefox (latest versions).
I also attached my project so that you can test on your side.
Thanks for the quick reply. As far as I know, Sitecore uses version 2017.2.711. I have investigated the issue and found that the markup is first inserted just fine, but later modified during calls to applyFix(...), _fixNestedParagraphs(...) and _unwrapElement(...) functions. Is there any way to alter this behaviour?
You can disable the ConvertToXhtml filter which should solve the problem in the older version:
You can also disable it through the ContentFilters property.
Thanks for the reply. Unfortunately, disabling the filter did not solve the issue.
In this case, I can see two different approaches:
- contact Sitecore support and ask them how you can upgrade the Telerik.Web.UI.dll to the latest version in their CMS system - this is the recommended approach since we can implement fixes for the upcoming versions only. Please check out this article: Bug Fixes.
- or override the applyFix or _fixNestedParagraphs functions on your own and resolve the issue in the older version: