0

In Sitecore 10.3 Update 0, when I add a <video> element in the RTE, Sitecore adds &#8203; (a zero-width space HTML entity) at the beginning and end of the content in the RTE.

Input:

<p>Some text</p>
<p>Some More text </p>
<p><video controls="true" width="560" height="315">
<source src="/mediafiles/My%20Video%20Name%Is,%20This%202024-03-28.mp4" type="video/mp4"></source>
</video></p>
<p>Some footer text</p>

After accepting and reopening the HTML editor, you can see the problematic values added at the beginning and end of the content:

rte issue

If I remove the &#8203; values and accept, it just gets added back again.

The issue can also be replicated by entering only <video></video> but the example above is better because you can see &#8203; wrapping the entire raw value rather than just around the <video> element.

The expectation is that shouldn't happen. Is this a bug? I'm not finding any information about this.

1
  • RichText is for rich text - its for styled text content. Its not really there to add html elements. If you want to do that, you should use a multiline text or just create a video component. IIRC - the RTE will try and strip out any "code" that it finds.
    – Richard Seal
    Apr 2 at 18:12

2 Answers 2

1

This is being set from the EditHtml control through the codebeside below located at the 'sitecore\shell\Applications\Content Manager\Dialogs\EditHtml' path.

Sitecore.Shell.Applications.ContentEditor.Dialogs.EditHtml.EditHtmlPage,Sitecore.Client

enter image description here

Its a zero width space character intended for line break control, that is added for the HTML validation made in the browser. You can find more reference on this entity below:

https://stackoverflow.com/questions/2973698/whats-html-character-code-8203

Hope this helps!!

1

Sitecore Support was able to reproduce this issue on a clean install. They registered this as a bug in the current version of Sitecore (10.3.x) and provided a reference number 464122.

A workaround fix was also provided which involves overriding the Shell.Applications.ContentEditor.Dialogs.EditHtml.EditHtmlPage class from Sitecore.Client.dll and modifying RTEFixes.js in the <website>\sitecore\shell\Controls\Rich Text Editor folder. Specifically, modifying the fixVideoHtml() function.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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