···11import { slug as slugAnchor } from "github-slugger"
22import type { Element as HastElement } from "hast"
33+import rfdc from "rfdc"
44+55+const clone = rfdc()
66+37// this file must be isomorphic so it can't use node libs (e.g. path)
4859export const QUARTZ = "quartz"
···121125 }
122126}
123127124124-export function normalizeHastElement(el: HastElement, curBase: FullSlug, newBase: FullSlug) {
128128+export function normalizeHastElement(rawEl: HastElement, curBase: FullSlug, newBase: FullSlug) {
129129+ const el = clone(rawEl) // clone so we dont modify the original page
125130 _rebaseHastElement(el, "src", curBase, newBase)
126131 _rebaseHastElement(el, "href", curBase, newBase)
127132 if (el.children) {