asp.net-mvctinymce-plugins

TinyMce Code plugin - Font Awesome / List


I am using TinyMce 4.1.3 Code plugin in MVC 5 application. When I insert

 <ul class="fa-ul">
    <li><i class="fa-li fa fa-square" style="color: #f9a01b"></i> text </li>
 </ul>

The Code plugin saves it as

 <ul class="fa-ul">
    <li>text </li>
 </ul>

Is there a workaournd this!


Solution

  • if you want to add some specific elements that also should be valid you can use the below source: https://www.tiny.cloud/docs-4x/configure/content-filtering/#extended_valid_elements

    tinymce.init({
      // other options...
      extended_valid_elements: "i[class|style]",
    });