Skip to content

Commit

Permalink
support gapFiller (gap-filler) option in remark-cq
Browse files Browse the repository at this point in the history
  • Loading branch information
pozymasika committed Dec 13, 2021
1 parent db36bdc commit a70e151
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/remark-cq/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a70e151

Please sign in to comment.