Skip to content

Commit

Permalink
Merge pull request #62 from pozymasika/gap-filler-option
Browse files Browse the repository at this point in the history
support gapFiller (gap-filler) option in remark-cq
  • Loading branch information
jashmenn authored Dec 13, 2021
2 parents db36bdc + a70e151 commit cfca575
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 cfca575

Please sign in to comment.