Severin
Severin

Reputation: 183

Kendo UI Editor, show HTML in Editor with encode html entities

I would like to see HTML in the Kendo UI Editor like

<h1>Hello World</h1>

How can i do these?

Upvotes: 0

Views: 2717

Answers (1)

Severin
Severin

Reputation: 183

My sample show on: https://dojo.telerik.com/ezOPAz/3

  $("#editor").kendoEditor({
    value: "<h1>Hello World</h1>",
    encoded: false,
            tools: [
                "viewHtml"
            ],
    deserialization: {
              custom: function(html) {
                 var encodedStr = html.replace(/[\u00A0-\u9999<>\&]/gim, function(i) {
                     return '&#'+i.charCodeAt(0)+';';
                  });
                return encodedStr;
              }
          }
  });

Upvotes: 1

Related Questions