diff --git a/quartz/plugins/index.ts b/quartz/plugins/index.ts
index 7e665fc74..358c59e07 100644
--- a/quartz/plugins/index.ts
+++ b/quartz/plugins/index.ts
@@ -14,7 +14,8 @@ export type ComponentResources = {
}
function joinScripts(scripts: string[]): string {
- return scripts.join("\n")
+ // wrap with iife to prevent scope collision
+ return scripts.map(script => `(function () {${script}})();`).join("\n")
}
export function emitComponentResources(cfg: GlobalConfiguration, resources: StaticResources, plugins: PluginTypes, emit: EmitCallback) {
diff --git a/quartz/plugins/transformers/links.ts b/quartz/plugins/transformers/links.ts
index 16193442b..4bf0e08ee 100644
--- a/quartz/plugins/transformers/links.ts
+++ b/quartz/plugins/transformers/links.ts
@@ -48,6 +48,8 @@ export const ResolveLinks: QuartzTransformerPlugin
| undefined>
// don't process external links or intra-document anchors
if (!(isAbsoluteUrl(node.properties.href) || node.properties.href.startsWith("#"))) {
node.properties.href = transformLink(node.properties.href)
+ } else {
+
}
// rewrite link internals if prettylinks is on