Apply suggestions from code review

This commit is contained in:
Aaron Pham 2025-03-03 01:45:28 -05:00 committed by GitHub
parent 2752c3a62d
commit 84349af6dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -225,13 +225,13 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
if (opts.enableInlineFootnotes) {
// Replaces ^[inline] footnotes with regular footnotes [^1]:
const footnotes: Record<string, string> = {}
let counter = 1
let counter = 0
// Replace inline footnotes with references and collect definitions
const result = (src as string).replace(
inlineFootnoteRegex,
(_match: string, content: string) => {
const id = `inline-${counter++}`
const id = `generated-inline-footnote-${counter++}`
footnotes[id] = content.trim()
return `[^${id}]`
},