Edit this page

Set Encoded Special Characters as Editor Values

Environment

Product Progress Kendo UI Editor
Operating System All
Browser All
Preferred Language JavaScript

Description

How can I set the encoded special characters as Editor values and display them decoded?

Solution

Prior to passing them as a parameter to the value method of the Editor, decode the encoded special characters.

<textarea id="editor"></textarea>
<script>
    $("#editor").kendoEditor();

    var editor = $("#editor").data("kendoEditor");
    var encodedString = "&lt;p&gt;Paragraph with a &gt; special character inside.&lt;/p&gt";
    var parser = new DOMParser;
    var dom = parser.parseFromString(
        '<!doctype html><body>' + encodedString,
        'text/html');
    var decodedString = dom.body.textContent;

    editor.value(decodedString);
</script>
Is this article helpful? Yes / No
Thank you for your feedback!

Give article feedback

Tell us how we can improve this article

close
Dummy