<commit_before>var demo = function () {
   
   el = document.getElementById('demo');

   input = document.getElementById('input');
   output = document.getElementById('output');

   function type(string, callback, p) {
      
      if (!p) {
         p = document.createElement('p');
         output.appendChild(p);
      }

      if (string === '') {
         return callback()
      }

      setTimeout(function(){
         var character = string.slice(0,1);
             string = string.slice(1);

         p.innerHTML += character;
         type(string, callback, p)
      }, Math.floor(Math.random()*100)+40); 
   }

   function crossOut(count, callback) {

      var i = 1;

      var lastP = output.lastChild,
          lastPText = lastP.firstChild;

      selectChars(count);

      function selectChars(count) {

         if (count === i) {
            var selectedText = window.getSelection();
            typewriter().strikeOut(selectedText);
            return callback()
         };

         var range = document.createRange();

         range.selectNode(lastPText);
         range.setStart(lastPText, lastPText.length - i);

         var selection = window.getSelection();

         selection.removeAllRanges();
         selection.addRange(range);

         i++;

         setTimeout(function(){
            selectChars(count);
         }, Math.floor(Math.random()*200) + 100); 

      }
   }

   function newLine (callback) {

      setTimeout(function(){

         p = document.createElement('p');
         p.innerHTML = '&#xfeff;';
         output.appendChild(p);

         setTimeout(function(){
            return callback()
         }, Math.floor(Math.random()*200) + 100);

      }, Math.floor(Math.random()*200) + 100);
   }

   return function () {
      // input.onkeydown = function(e){return e.preventDefault()};

      typewriter().init();

      output.innerHTML = '';
      input.innerHTML = '';


      input.setAttribute('style', 'display:none');
      type('Typewriter is a simple text editor.', function(){

      newLine(function(){
      
      type(' Every letter you type is permanent. No editing. No formatting. A bit like a real typewriter.', function(){

      newLine(function(){
      
      type('Deleting text just strikes it out, so you can cover up mistskes', function(){

      crossOut(9, function(){
            
      type(' mistakes.', function(){    

      newLine(function(){
      
      type('Typewrite is perfect for first drafts. For forcing your ideas onto the page. For fixing writer\'s block.', function(){
      
      typewriter().setHTMLof(input).to(output)
            
            input.setAttribute('style', 'display:block');               
      });
      });
      }, output.lastChild);          
      });
      });
      });
      });
      });
      });
   }()
}
<commit_msg>tweaked demo copy<commit_after>var demo = function () {
   
   el = document.getElementById('demo');

   input = document.getElementById('input');
   output = document.getElementById('output');

   function type(string, callback, p) {
      
      if (!p) {
         p = document.createElement('p');
         output.appendChild(p);
      }

      if (string === '') {
         return callback()
      }

      setTimeout(function(){
         var character = string.slice(0,1);
             string = string.slice(1);

         p.innerHTML += character;
         type(string, callback, p)
      }, Math.floor(Math.random()*100)+40); 
   }

   function crossOut(count, callback) {

      var i = 1;

      var lastP = output.lastChild,
          lastPText = lastP.firstChild;

      selectChars(count);

      function selectChars(count) {

         if (count === i) {
            var selectedText = window.getSelection();
            typewriter().strikeOut(selectedText);
            return callback()
         };

         var range = document.createRange();

         range.selectNode(lastPText);
         range.setStart(lastPText, lastPText.length - i);

         var selection = window.getSelection();

         selection.removeAllRanges();
         selection.addRange(range);

         i++;

         setTimeout(function(){
            selectChars(count);
         }, Math.floor(Math.random()*200) + 100); 

      }
   }

   function newLine (callback) {

      setTimeout(function(){

         p = document.createElement('p');
         p.innerHTML = '&#xfeff;';
         output.appendChild(p);

         setTimeout(function(){
            return callback()
         }, Math.floor(Math.random()*200) + 100);

      }, Math.floor(Math.random()*200) + 100);
   }

   return function () {
      // input.onkeydown = function(e){return e.preventDefault()};

      typewriter().init();

      output.innerHTML = '';
      input.innerHTML = '';


      input.setAttribute('style', 'display:none');
      type('Typewriter is a simple text editor.', function(){

      newLine(function(){
      
      type('Every letter you type is permanent. A bit like a real typewriter.', function(){

      newLine(function(){
      
      type('You can\'t delete your mistakes but you can coevr', function(){

      crossOut(6, function(){
            
      type(' cover them up.', function(){    

      newLine(function(){
      
      type('Typewriter is perfect for first drafts. For forcing your ideas onto the page. For fixing writer\'s block.', function(){
      
      typewriter().setHTMLof(input).to(output)
            
            input.setAttribute('style', 'display:block');               
      });
      });
      }, output.lastChild);          
      });
      });
      });
      });
      });
      });
   }()
}

{'fraction_non_alphanumeric': 0.14141949152542374, 'fraction_numerical': 0.009887005649717515, 'mean_word_length': 1.9597701149425288, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1589064', 'n_tokens_mistral': 1596, 'n_tokens_neox': 1494, 'n_words': 332}