The Telerik Editor is loaded as a partial view on Ajax Post request. The text containing code within pre tags, prettyprint class, in a div element on some part of the form is extracted and passed as a string to the action method for rendering Telerik Editor partial view. The Telerik Editor loads that string from javascript on client side using telerik.editor.min.js file. This file removes the indentation. The root cause for this issue is found to be β.replace(/[\r\n\v\f\t ]+/ig," ")β at the code block βvar a5=a3.val().replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/ig,"$1").replace(/[\r\n\v\f\t ]+/ig," ");β.
Hence, the following code change resolved the problem.
1) telerik.editor.min.js: Resolved indentation issue
From:- var a5=a3.val().replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/ig,"$1").replace(/[\r\n\v\f\t ]+/ig," ");
To:- var a5=a3.val().replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/ig,"$1");
Please let me know for any other best alternatives.
Thank You.