'use strict';

var parser = require('parser-front-matter');
var merge = require('mixin-deep');

/**
 * Default middleware for parsing front-matter
 */

module.exports = function matter(app) {
  return function (file, next) {
    var opts = merge({}, app.options, file.options);
    parser.parse(file, opts, function (err) {
      if (err) return next(err);
      next();
    });
  };
};

@@ -57,21 +57,22 @@
 ');%0Avar 
-merge
+extend
  = requi
@@ -79,18 +79,22 @@
 re('
-mixin-deep
+extend-shallow
 ');%0A
@@ -179,22 +179,54 @@
 tion
- matter
 (app) %7B
+%0A  var options = app.option('matter');%0A
 %0A  r
@@ -274,46 +274,272 @@
 s = 
-merge(%7B%7D, app.options, file.option
+file.options;%0A%0A    // we only want file options here, not application options%0A    if (opts.matter === false %7C%7C opts.noread === true %7C%7C opts.read === false) %7B%0A      return next();%0A    %7D%0A%0A    // shallow clone the options%0A    var config = extend(%7B%7D, options, opt
 s);%0A
+%0A
     
@@ -557,20 +557,22 @@
 e(file, 
-opts
+config
 , functi

allow front matter to be skipped