fix: replace image http to https

This commit is contained in:
DIYgod
2023-05-03 13:42:57 +01:00
parent 3e7b92f7bd
commit 207479b6ce
+2 -1
View File
@@ -35,7 +35,8 @@ export const rehypeImage: Plugin<Array<{ env: MarkdownEnv }>, Root> = ({
if (isExternLink(url)) {
if (!url.startsWith("https:") && IS_PROD) {
throw new Error(`External image url must start with https`)
console.error(`External image url must start with https: ${url}`)
url.replace(/^http:/, "https:")
}
return
}