mirror of
https://github.com/ZetaKebab/quartz.git
synced 2025-06-21 16:24:36 +00:00
Check link isExternal before adding target="_blank" (#1211)
Fixes #1186 openLinksInNewTab opens ALL links in new tabs. Fixed to reflect documented behavior here: https://quartz.jzhao.xyz/plugins/CrawlLinks
This commit is contained in:
@ -93,7 +93,7 @@ export const CrawlLinks: QuartzTransformerPlugin<Partial<Options> | undefined> =
|
|||||||
}
|
}
|
||||||
node.properties.className = classes
|
node.properties.className = classes
|
||||||
|
|
||||||
if (opts.openLinksInNewTab) {
|
if (isExternal && opts.openLinksInNewTab) {
|
||||||
node.properties.target = "_blank"
|
node.properties.target = "_blank"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user