@@ -6,7 +6,6 @@ const toHAST = require(`mdast-util-to-hast`)
66const hastToHTML = require ( `hast-util-to-html` )
77const mdastToToc = require ( `mdast-util-toc` )
88const mdastToString = require ( `mdast-util-to-string` )
9- const Promise = require ( `bluebird` )
109const unified = require ( `unified` )
1110const parse = require ( `remark-parse` )
1211const stringify = require ( `remark-stringify` )
@@ -116,7 +115,7 @@ module.exports = function remarkExtendNodeType(
116115 }
117116 let remark = new Remark ( ) . data ( `settings` , remarkOptions )
118117
119- for ( let plugin of pluginOptions . plugins ) {
118+ for ( const plugin of pluginOptions . plugins ) {
120119 const requiredPlugin = require ( plugin . resolve )
121120 if ( _ . isFunction ( requiredPlugin . setParserPlugins ) ) {
122121 for ( let parserPlugin of requiredPlugin . setParserPlugins (
@@ -193,8 +192,8 @@ module.exports = function remarkExtendNodeType(
193192 if ( process . env . NODE_ENV !== `production` || ! fileNodes ) {
194193 fileNodes = getNodesByType ( `File` )
195194 }
196- // Use Bluebird's Promise function "each" to run remark plugins serially.
197- await Promise . each ( pluginOptions . plugins , plugin => {
195+ // Use a for loop to run remark plugins serially.
196+ for ( const plugin of pluginOptions . plugins ) {
198197 const requiredPlugin = require ( plugin . resolve )
199198 // Allow both exports = function(), and exports.default = function()
200199 const defaultFunction = _ . isFunction ( requiredPlugin )
@@ -204,7 +203,7 @@ module.exports = function remarkExtendNodeType(
204203 : undefined
205204
206205 if ( defaultFunction ) {
207- return defaultFunction (
206+ await defaultFunction (
208207 {
209208 markdownAST,
210209 markdownNode,
@@ -220,10 +219,8 @@ module.exports = function remarkExtendNodeType(
220219 } ,
221220 plugin . pluginOptions
222221 )
223- } else {
224- return Promise . resolve ( )
225222 }
226- } )
223+ }
227224
228225 return markdownAST
229226 }
@@ -236,7 +233,7 @@ module.exports = function remarkExtendNodeType(
236233 // Execute the remark plugins that can mutate the node
237234 // before parsing its content
238235 //
239- // Use Bluebird's Promise function "each" to run remark plugins serially.
236+ // Use for loop to run remark plugins serially.
240237 for ( const plugin of pluginOptions . plugins ) {
241238 const requiredPlugin = require ( plugin . resolve )
242239 if ( typeof requiredPlugin . mutateSource === `function` ) {
0 commit comments