feat: embed webp images (#666)

This commit is contained in:
Mats Fangohr 2024-01-02 17:03:05 +01:00 committed by GitHub
parent b33f13ccaf
commit 6e34844114
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -201,7 +201,7 @@ export const ObsidianFlavoredMarkdown: QuartzTransformerPlugin<Partial<Options>
if (value.startsWith("!")) { if (value.startsWith("!")) {
const ext: string = path.extname(fp).toLowerCase() const ext: string = path.extname(fp).toLowerCase()
const url = slugifyFilePath(fp as FilePath) const url = slugifyFilePath(fp as FilePath)
if ([".png", ".jpg", ".jpeg", ".gif", ".bmp", ".svg"].includes(ext)) { if ([".png", ".jpg", ".jpeg", ".gif", ".bmp", ".svg", ".webp"].includes(ext)) {
const dims = alias ?? "" const dims = alias ?? ""
let [width, height] = dims.split("x", 2) let [width, height] = dims.split("x", 2)
width ||= "auto" width ||= "auto"