From 2f92451b8b91fce5d9c6e0daf74f06c503dfd620 Mon Sep 17 00:00:00 2001 From: Jeff Escalante Date: Thu, 10 Oct 2019 19:27:36 -0400 Subject: [PATCH] bugfix --- plugins/include-markdown/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/include-markdown/index.js b/plugins/include-markdown/index.js index 71ba4aa..416dba6 100644 --- a/plugins/include-markdown/index.js +++ b/plugins/include-markdown/index.js @@ -9,9 +9,9 @@ module.exports = function includeMarkdownPlugin({ resolveFrom } = {}) { if (node.type !== 'paragraph') return [node] // detect an `@include` statement - const includeMatch = node.children[0].value.match( - /^@include\s['"](.*)['"]$/ - ) + const includeMatch = + node.children[0].value && + node.children[0].value.match(/^@include\s['"](.*)['"]$/) if (!includeMatch) return [node] // read the file contents