Edit this page

Replace All String Occurrences in Editor Content

Environment

Product Progress Kendo UI Editor

Description

How can I replace all specific string occurrences in the Kendo UI Editor content?

Solution

Use the deserioalization.custom option of the Editor to plug a custom callback that will return the modified content.

<div id="example">
    <div class="demo-section k-content">
        <textarea id="editor"></textarea>
    </div>
</div>

<script>
    $("#editor").kendoEditor({
        value: "Random @text@ with several @placeholders@.",
        deserialization: {
          custom: function(html) {
            return html.replace(/@(.*?)@/gi, "strings");
          }
        }
    });
</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