From cd93c103bf6d00a37d5f492b0e6ed2abac26f73c Mon Sep 17 00:00:00 2001 From: Blake Kostner Date: Sat, 27 Aug 2016 12:40:54 -0700 Subject: [PATCH] always return an object for locals, even if it's empty --- lib/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/index.js b/lib/index.js index 6b2c134..14ac2e5 100644 --- a/lib/index.js +++ b/lib/index.js @@ -25,6 +25,9 @@ module.exports = function spikeHtmlStandards (options = {}) { let parserOpt = options.parser || sugarml if (options.parser === false) parserOpt = undefined + // Always return an object for locals + if (typeof options.locals === 'undefined') options.locals = {} + // If the user has not overridden the default markdown function, initialize // markdown-it and add the default let contentOpt = options.content || {}