(function($){




// Start codeMirror
var editor = CodeMirror.fromTextArea(document.getElementById('codeInput'), {
  lineNumbers: true,
  matchBrackets: true
});


// Define DOM areas
var $form = $('#magia')
  , $targetLink = $('#a-holder')
  , $codeInput = $('#codeInput')
  , $linkName = $('#nome')


// Make the form parse JS User Input
$form.submit(function(e){
  e.preventDefault();

  var raw = $codeInput.val()
    , parsedJs = raw
        .replace(/\/\/.*/g,'')     // Delete commentaries
        .replace(/'/g,'%27')       // Safe single quotes
        .replace(/"/g,'%22')       // Safe double quotes
        .replace(/[\r\n\t]/g,' ')  // No newlines or tabs
        .replace(/ +/g,' ')        // No extra spaces
    , nome = $linkName.val()
    , hasJq = $('#hasJQuery:checked').length
    , aHref = hasJq ?
        "javascript:(function(){if(typeof ZHJ1bW1lcg === 'undefined'){var jQueryScript=document.createElement('script');jQueryScript.setAttribute('src','//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');var caput=document.getElementsByTagName('head');caput[0].appendChild(jQueryScript);ZHJ1bW1lcg=true;}setTimeout(function(){$(document).ready(function(){"+ parsedJs +"});},200);})();"
          :
        "javascript:(function(){"+ parsedJs +"})();"
    , aElement = '<a href="'+aHref+'">'+nome+'</a>'

  $targetLink.empty().append(aElement);
});




})(jQuery)

@@ -432,16 +432,86 @@
 s = raw%0A
+        .replace(/%5C/%5C*%5B%5Cs%5CS%5D*?%5C*%5C//g,'') // Delete block commentaries%0A
         
@@ -532,16 +532,22 @@
 .*/g,'')
+      
      // 
@@ -553,16 +553,28 @@
  Delete 
+single line 
 commenta
@@ -606,16 +606,22 @@
 g,'%2527')
+      
        /
@@ -672,24 +672,30 @@
 %2522')       
+    
+  
 // Safe doub
@@ -737,16 +737,22 @@
 %5D/g,' ')
+      
   // No 
@@ -791,24 +791,30 @@
 e(/ +/g,' ')
+      
         // N

Delete block commentaries on user raw code input