Consider implementing logic that strips js comments from the Kendo templates.
If the following js function is added into the Grid's custom popup editor:
<script>
(function () {
alert(1)
})();
</script>
the function won't work, because the when the template is serialized the content of the script tag is put into one line, which causes everything after the comment to get commented.
A possible workaround is to use the following comment syntax:
<script>
(function () {
alert(1)
})();
</script>
However, it would be helpful if there is dedicated logic that strips comments from the script tags, as this would allow using either of the comment syntaxes.