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:
Paul Trotter 2024-06-17 00:33:28 -05:00 committed by GitHub
parent 3e14b2b89b
commit 42640bceb5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -93,7 +93,7 @@ export const CrawlLinks: QuartzTransformerPlugin<Partial<Options> | undefined> =
}
node.properties.className = classes
if (opts.openLinksInNewTab) {
if (isExternal && opts.openLinksInNewTab) {
node.properties.target = "_blank"
}