diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 1e81c6d..9e88d16 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -155,12 +155,12 @@ var ICEcoder = { contentCleanUp: function() { var fileName, cM, content; - // If it's not a JS, CoffeeScript Ruby, CSS or LESS file, replace our temp value + // If it's not a JS, CoffeeScript Ruby, CSS or LESS file, replace our temp /textarea value fileName = ICEcoder.openFiles[ICEcoder.selectedTab-1]; if (["js","coffee","rb","css","less"].indexOf(fileName.split(".")[1])<0) { cM = ICEcoder.getcMInstance(); content = cM.getValue(); - content = content.replace(//g,''); + content = content.replace(//g,'<\/textarea>'); // Then set the content in the editor & clear the history cM.setValue(content); @@ -267,14 +267,14 @@ var ICEcoder = { } } else { if (cM.somethingSelected()) { - cM.replaceSelection(cM.getSelection().slice(0,4)!="" + cM.replaceSelection(cM.getSelection().slice(0,4)!="<\!--" + ? "<\!--" + cM.getSelection() + "//-->" : cM.getSelection().slice(4,cM.getSelection().length-5)); } else { - cM.setLine(linePos, lineContent.slice(0,4)!="" + cM.setLine(linePos, lineContent.slice(0,4)!="<\!--" + ? "<\!--" + lineContent + "//-->" : lineContent.slice(4,lCLen).slice(0,lCLen-9)); - adjustCursor = lineContent.slice(0,4)=="