mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-27 23:04:05 -06:00
Fixed image theme check
This commit is contained in:
parent
5a72e0a54a
commit
6867034ec9
@ -24,8 +24,9 @@ export function renderThemedLinks(theme: "dark" | "light") {
|
||||
const imageGroups = { theme: 1, extension: 2 }
|
||||
Object.values(document.getElementsByTagName("img")).forEach((img) => {
|
||||
if (img.src.match(imageExtensions)) {
|
||||
const newImg = imageExtensions.exec(img.src)
|
||||
img.src.replace(imageExtensions, `.${theme}.${newImg![imageGroups.extension]}`)
|
||||
const imageSource = img.src
|
||||
const newImg = imageExtensions.exec(imageSource)
|
||||
img.src = imageSource.replace(imageExtensions, `.${theme}.${newImg![imageGroups.extension]}`)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user