code: function formParagraphs(text) {
  
          text = text.replace(/^\n+/g,"");
          text = text.replace(/\n+$/g,"");
  
          var grafs = text.split(/\n{2,}/g);
          var grafsOut = new Array();
          var end = grafs.length;
  
          for(var i=0; i<end; i++) {
              var str = grafs[i];
  
              if(str.search(/~K(\d+)K/g) >= 0) {
                  grafsOut.push(str);
              } else if (str.search(/\S/) >= 0) {
                  str = runSpanGamut(str);
                  str = str.replace(/^([ \t]*)/g,"<p>");
                  str += "</p>"
                  grafsOut.push(str);
              }
  
          }
  
          end = grafsOut.length;
  
          for(var i=0; i<end; i++) {
              while(grafsOut[i].search(/~K(\d+)K/) >= 0) {
                  var blockText = htmlBlock[RegExp.$1];
                  blockText = blockText.replace(/\$/g,"$$$$");
                  grafsOut[i] = grafsOut[i].replace(/~K\d+K/,blockText);
              }
          }
  
          return grafsOut.join("\n\n");
      }
docs: }}} {{{ formParagraphs