From 42dcfc5d07f87eae501cf231efe63777e172c9de Mon Sep 17 00:00:00 2001 From: Saneef Ansari Date: Wed, 29 Nov 2023 01:12:57 +0530 Subject: [PATCH] fix: don't mutate attributes subsquent calls will have the mutated options --- lib/eleventy-asciidoc.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/eleventy-asciidoc.js b/lib/eleventy-asciidoc.js index 3844e10..9176262 100644 --- a/lib/eleventy-asciidoc.js +++ b/lib/eleventy-asciidoc.js @@ -73,7 +73,7 @@ function eleventyAsciidoctor(convertOptions = {}) { let { base_dir, configure_extension_registry } = options; const attributes = parseDocumentAttributes(options.attributes ?? {}); - const { outdir } = attributes; + let { outdir } = attributes; base_dir = base_dir === undefined ? path.dirname(inputPath) : base_dir; @@ -81,7 +81,7 @@ function eleventyAsciidoctor(convertOptions = {}) { const { page } = data ?? {}; const { outputPath } = page ?? {}; if (outputPath !== undefined) { - attributes.outdir = path.dirname(outputPath); + outdir = path.dirname(outputPath); } } @@ -101,6 +101,7 @@ function eleventyAsciidoctor(convertOptions = {}) { ...options, attributes: { ...attributes, + outdir, }, base_dir, extension_registry: registry,