There was an error while loading. Please reload this page.
1 parent 32aceb4 commit 8534b65Copy full SHA for 8534b65
lib/ghost-normalize.ts
@@ -62,7 +62,7 @@ const withRewriteGhostLinks =
62
(cmsUrl: UrlWithStringQuery, basePath = '/') =>
63
(htmlAst: Node) => {
64
visit(htmlAst, { tagName: `a` }, (node: LinkElement) => {
65
- if (!node.properties) return
+ if (!node.properties || !node.properties.href) return
66
const href = urlParse(node.properties.href)
67
if (href.protocol === cmsUrl.protocol && href.host === cmsUrl.host) {
68
node.properties.href = basePath + href.pathname?.substring(1)
0 commit comments