mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-26 14:24:05 -06:00
Apply suggestions from code review
This commit is contained in:
parent
2752c3a62d
commit
84349af6dd
@ -225,13 +225,13 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
|
|||||||
if (opts.enableInlineFootnotes) {
|
if (opts.enableInlineFootnotes) {
|
||||||
// Replaces ^[inline] footnotes with regular footnotes [^1]:
|
// Replaces ^[inline] footnotes with regular footnotes [^1]:
|
||||||
const footnotes: Record<string, string> = {}
|
const footnotes: Record<string, string> = {}
|
||||||
let counter = 1
|
let counter = 0
|
||||||
|
|
||||||
// Replace inline footnotes with references and collect definitions
|
// Replace inline footnotes with references and collect definitions
|
||||||
const result = (src as string).replace(
|
const result = (src as string).replace(
|
||||||
inlineFootnoteRegex,
|
inlineFootnoteRegex,
|
||||||
(_match: string, content: string) => {
|
(_match: string, content: string) => {
|
||||||
const id = `inline-${counter++}`
|
const id = `generated-inline-footnote-${counter++}`
|
||||||
footnotes[id] = content.trim()
|
footnotes[id] = content.trim()
|
||||||
return `[^${id}]`
|
return `[^${id}]`
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user