1
0
mirror of https://github.com/nolanlawson/pinafore synced 2024-12-08 08:24:19 +01:00

Make external links open in new tab (#892)

This commit is contained in:
Will Pearson 2019-01-13 16:05:41 -08:00 committed by Nolan Lawson
parent ef44c19e8a
commit cb35a088f4

View File

@ -111,6 +111,9 @@
} else if (anchor.getAttribute('rel') === 'nofollow noopener') {
anchor.setAttribute('title', href)
}
if (anchor.getAttribute('href')[0] !== '/' || anchor.getAttribute('href')[1] === '/') {
anchor.setAttribute('target', '_blank')
}
}
stop('hydrateContent')
}