'use strict';

var mu = require('middleware-utils');
var middleware = require('../../middleware/');
var utils = require('../../utils/');

/**
 * Initialize default middleware
 */

module.exports = function middleware_(verb) {
  verb.onLoad(/\.js$/, utils.parallel([
    middleware.copyright(verb),
    middleware.todos(verb),
  ]), mu.error('onLoad (js)'));

  verb.onLoad(/\.md$/, utils.series([
    middleware.conflict(verb),
    middleware.copyright(verb),
    middleware.props,
    middleware.cwd(verb),
    middleware.engine,
    middleware.src,
    middleware.dest,
    middleware.ext,
    middleware.lint(verb),
    require('template-toc')(verb),
    utils.escape,
  ]), mu.error('onLoad (md)'));

  verb.preRender(/\.md$/, utils.parallel([
    middleware.lint(verb),
    middleware.readme,
  ]), mu.error('preRender (md)'));

  verb.postRender(/\.md$/, utils.parallel([
    utils.unescape,
    middleware['lint-after'](verb),
    middleware.diff(verb),
  ]), mu.error('postRender'));
};

@@ -12,46 +12,8 @@
 ';%0A%0A
-var mu = require('middleware-utils');%0A
 var 
@@ -59,21 +59,18 @@
 ');%0Avar 
+m
 u
-tils
  = requi
@@ -77,20 +77,24 @@
 re('
-../../
+middleware-
 utils
-/
 ');%0A
@@ -182,16 +182,45 @@
 verb) %7B%0A
+  var delims = mu.delims();%0A%0A
   verb.o
@@ -230,29 +230,26 @@
 ad(/%5C.js$/, 
+m
 u
-tils
 .parallel(%5B%0A
@@ -364,21 +364,18 @@
 %5C.md$/, 
+m
 u
-tils
 .series(
@@ -641,20 +641,21 @@
     
-util
+delim
 s.escape
 ,%0A  
@@ -646,24 +646,26 @@
 elims.escape
+()
 ,%0A  %5D), mu.e
@@ -705,37 +705,34 @@
 Render(/%5C.md$/, 
+m
 u
-tils
 .parallel(%5B%0A    
@@ -840,21 +840,18 @@
 %5C.md$/, 
+m
 u
-tils
 .paralle
@@ -858,20 +858,21 @@
 l(%5B%0A    
-util
+delim
 s.unesca
@@ -873,16 +873,18 @@
 unescape
+()
 ,%0A    mi

use middleware-utils for escaping