Skip to content

Commit

Permalink
Fix some linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
vrugtehagel committed Jun 16, 2024
1 parent dd8047e commit 2449d40
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ export default function EleventyDocumentOutline(
/** The transform responsible for actually generating and rendering the links */
config.addTransform(
"document-outline",
async function (this: any, content: string) {
function (this: any, content: string) {
const outputPath = this.page.outputPath as string;
if (!outputPath.endsWith(".html")) return content;

const included = [...memory].filter(([uuid]) => content.includes(uuid));
const necessaryHeaders = included.flatMap(([uuid, headers]) => headers);
const necessaryHeaders = included.flatMap(([_uuid, headers]) => headers);
const uniqueHeaders = [...new Set(necessaryHeaders)];
const root = HTMLParser.parse(content);
const selector = uniqueHeaders.join(",");
Expand All @@ -81,7 +81,7 @@ export default function EleventyDocumentOutline(
const normalized = headers.map((header) => normalize(header));
const output = matches
.filter(([header]) => normalized.includes(header))
.map(([header, output]) => output)
.map(([_header, output]) => output)
.join("");
result = result.replaceAll(uuid, output);
}
Expand Down

0 comments on commit 2449d40

Please sign in to comment.