Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Graham Davis 109 posts 364 karma points
    Oct 21, 2020 @ 14:01
    Graham Davis

    Rich Text Editor re-writing HTML Code

    I am upgrading a site to Umbraco 8 and am having difficultly with the Rich Text Editor either not rendering the HTML or rewriting it to the point that it does not function. Escaping the HTML used to work, but this no longer seems to be the case in Version 8. Any suggestions?

    <div>&lt;video style="width:100%;" poster="" controls&gt; &lt;source src="" type="video/mp4" /&gt; &lt;/video&gt; <br /><br /><br /></div>

    enter image description here

  • Anzal 11 posts 81 karma points
    Oct 21, 2020 @ 17:39

    Hi, While rendering RTE content the code should be as


    Is this the same you were using in your code?

  • Graham Davis 109 posts 364 karma points
    Oct 21, 2020 @ 18:25
    Graham Davis

    Yes. The RTE content is part of the umbraco grid and looks like:

    @Html.Raw(Html.GetGridHtml(Model.Content, "content"))
  • Anzal 11 posts 81 karma points
    Oct 22, 2020 @ 09:47

    If its a umbraco grid try only with

    Html.GetGridHtml(Model.Content, "content")

    No need for @Html.Raw()

  • Graham Davis 109 posts 364 karma points
    Oct 24, 2020 @ 00:29
    Graham Davis

    No Change removing Html.Raw. Right now, I am looking for a way to disable the RTE from reformatting the code. For example, if I don't escape the video tags, RTE completely removes it. If I do escape, it is changing &rt; to &amp;rt;

  • Graham Davis 109 posts 364 karma points
    Oct 25, 2020 @ 14:56
    Graham Davis

    I found my solution. In the file config\tinyMceConfig.config, add the html video tag to the safe list using video[*]. Once this is done, the html no longer has to be escaped.

    For the html Button, I was using i tags for font awesome icons, which tinymce is removing. Changing them to span works


    <a id="btnSignIn" href="#" class="btn btn-zpm-default"><i class="fa fa-download"></i> Download</a>


    <a id="btnSignIn" href="#" class="btn btn-zpm-default"><span class="fa fa-download"></span> Download</a>

Please Sign in or register to post replies

Write your reply to: