From a70e15137d28cd45fccbb0c6e4f3422fe942df1b Mon Sep 17 00:00:00 2001 From: Polycarp Masika Date: Mon, 13 Dec 2021 09:02:29 +0300 Subject: [PATCH] support gapFiller (gap-filler) option in remark-cq --- packages/remark-cq/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/remark-cq/index.js b/packages/remark-cq/index.js index 4f6d2dd..04c977d 100644 --- a/packages/remark-cq/index.js +++ b/packages/remark-cq/index.js @@ -154,6 +154,10 @@ function codeImportBlock(eat, value, silent) { if (__lastBlockAttributes["lang"]) { cqOpts.language = dequote(__lastBlockAttributes["lang"]); } + if (__lastBlockAttributes["gap-filler"]) { + cqOpts.gapFiller = + "\n " + dequote(__lastBlockAttributes["gap-filler"]) + "\n"; + } let newNode = { type: "cq", @@ -446,6 +450,9 @@ async function visitCq(ast, vFile, options) { if (!cqOpts.engine) { cqOpts.engine = engine; } + if (!cqOpts.gapFiller) { + cqOpts.gapFiller = "\n // ...\n"; + } debug(`${actualFilename} ` + JSON.stringify(cqOpts, null, 2)); let results;