Browse Source

fix: exclude assets from internal link detection (#1189)

pull/1271/head
NGPixel 5 years ago
parent
commit
e35e68d764
1 changed files with 5 additions and 3 deletions
  1. 8
      server/modules/rendering/html-core/renderer.js

8
server/modules/rendering/html-core/renderer.js

@ -53,7 +53,11 @@ module.exports = {
}
// -> Check for system prefix
if (!reservedPrefixes.test(href) && !exactReservedPaths.test(href)) {
if (reservedPrefixes.test(href) || exactReservedPaths.test(href)) {
$(elm).addClass(`is-system-link`)
} else if (href.indexOf('.') >= 0) {
$(elm).addClass(`is-asset-link`)
} else {
let pagePath = null
// -> Add locale prefix if using namespacing
@ -91,8 +95,6 @@ module.exports = {
})
$(elm).addClass(`is-internal-link`)
} else {
$(elm).addClass(`is-system-link`)
}
} else {
$(elm).addClass(`is-external-link`)

Loading…
Cancel
Save