The Trans Directory
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: deep clone before relativizing urls in transclude (closes #640)

+13 -1
+6
package-lock.json
··· 52 52 "remark-parse": "^11.0.0", 53 53 "remark-rehype": "^11.0.0", 54 54 "remark-smartypants": "^2.0.0", 55 + "rfdc": "^1.3.0", 55 56 "rimraf": "^5.0.5", 56 57 "serve-handler": "^6.1.5", 57 58 "shikiji": "^0.9.9", ··· 5160 5161 "iojs": ">=1.0.0", 5161 5162 "node": ">=0.10.0" 5162 5163 } 5164 + }, 5165 + "node_modules/rfdc": { 5166 + "version": "1.3.0", 5167 + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", 5168 + "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" 5163 5169 }, 5164 5170 "node_modules/rimraf": { 5165 5171 "version": "5.0.5",
+1
package.json
··· 77 77 "remark-parse": "^11.0.0", 78 78 "remark-rehype": "^11.0.0", 79 79 "remark-smartypants": "^2.0.0", 80 + "rfdc": "^1.3.0", 80 81 "rimraf": "^5.0.5", 81 82 "serve-handler": "^6.1.5", 82 83 "shikiji": "^0.9.9",
+6 -1
quartz/util/path.ts
··· 1 1 import { slug as slugAnchor } from "github-slugger" 2 2 import type { Element as HastElement } from "hast" 3 + import rfdc from "rfdc" 4 + 5 + const clone = rfdc() 6 + 3 7 // this file must be isomorphic so it can't use node libs (e.g. path) 4 8 5 9 export const QUARTZ = "quartz" ··· 121 125 } 122 126 } 123 127 124 - export function normalizeHastElement(el: HastElement, curBase: FullSlug, newBase: FullSlug) { 128 + export function normalizeHastElement(rawEl: HastElement, curBase: FullSlug, newBase: FullSlug) { 129 + const el = clone(rawEl) // clone so we dont modify the original page 125 130 _rebaseHastElement(el, "src", curBase, newBase) 126 131 _rebaseHastElement(el, "href", curBase, newBase) 127 132 if (el.children) {