Skip to content

Commit 74c4c30

Browse files
committed
♻️ Clarify purpose of function
1 parent 3a7c0ca commit 74c4c30

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/main.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const markdocPreprocess = (options: Options = {}): PreprocessorGroup => {
4646
for (const key in options) {
4747
if (!validOptionKeys.includes(key as keyof Options)) {
4848
log.warn(
49-
`Invalid option "${key}" provided and ignored. Check the documentation for valid options.`,
49+
`Invalid option "${key}" provided and ignored. Check the documentation for valid options.`
5050
);
5151
}
5252
}
@@ -70,10 +70,9 @@ export const markdocPreprocess = (options: Options = {}): PreprocessorGroup => {
7070
const layoutPath = options.layout;
7171
const allowComments = options.comments ?? true;
7272
const processHeadings = options.headingIds ?? false;
73-
// If passed `true`, use the default for slugging headings
74-
// Otherwise, use the passed function
73+
// Use custom slugger if provided, or fallback to default
7574
const headingSlugger =
76-
typeof processHeadings === "boolean" ? slug : processHeadings;
75+
typeof processHeadings === "function" ? processHeadings : slug;
7776
const linkify = options.linkify ?? false;
7877
const typographer = options.typographer ?? false;
7978
const validationLevel = options.validationLevel || "error";
@@ -213,7 +212,7 @@ export const markdocPreprocess = (options: Options = {}): PreprocessorGroup => {
213212
extractUsedSvelteComponents(transformedContent);
214213
const componentImportStatements = getComponentImports(
215214
usedSvelteComponentNames,
216-
componentsPath,
215+
componentsPath
217216
);
218217

219218
// Construct script tag content

0 commit comments

Comments
 (0)