Jacky Zhao
2023-08-12 83269ac26e41f8e81b56e000b4347ee60d4ff84b
quartz/plugins/transformers/links.ts
@@ -86,7 +86,8 @@
                if (
                  opts.prettyLinks &&
                  node.children.length === 1 &&
                  node.children[0].type === "text"
                  node.children[0].type === "text" &&
                  !node.children[0].value.startsWith("#")
                ) {
                  node.children[0].value = path.basename(node.children[0].value)
                }
@@ -99,9 +100,10 @@
                typeof node.properties.src === "string"
              ) {
                if (!isAbsoluteUrl(node.properties.src)) {
                  let dest = node.properties.src as RelativeURL
                  const ext = path.extname(node.properties.src)
                  node.properties.src =
                    transformLink(joinSegments("assets", node.properties.src)) + ext
                  dest = node.properties.src = transformLink(dest)
                  node.properties.src = dest + ext
                }
              }
            })