mirror of
https://github.com/jackyzha0/quartz.git
synced 2026-03-21 21:45:42 -05:00
Merge 7caddf6230 into 59b5807601
This commit is contained in:
commit
ac87db059a
@ -202,6 +202,17 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>>
|
||||
return `${embedDisplay}[${displayAlias.replace(/^\|/, "")}](${rawFp})`
|
||||
}
|
||||
|
||||
// Convert image embeds to standard markdown to prevent underscores
|
||||
// in filenames from being parsed as emphasis by the markdown parser.
|
||||
// Uses angle-bracket destination syntax to preserve special characters.
|
||||
if (embedDisplay === "!" && fp) {
|
||||
const ext = path.extname(fp).toLowerCase()
|
||||
if ([".png", ".jpg", ".jpeg", ".gif", ".bmp", ".svg", ".webp"].includes(ext)) {
|
||||
const alt = displayAlias ? displayAlias.replace(/^\|/, "").trim() : ""
|
||||
return ``
|
||||
}
|
||||
}
|
||||
|
||||
return `${embedDisplay}[[${fp}${displayAnchor}${displayAlias}]]`
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user