mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-19 02:04:10 +00:00
fix(links): handle uhuhu
This commit is contained in:
parent
2df6b6461b
commit
e5f6c4ba0f
1 changed files with 6 additions and 1 deletions
|
|
@ -8,7 +8,12 @@ export default {
|
|||
|
||||
for (let i = 0; i < allLinks.length; i += 1) {
|
||||
const link = allLinks[i];
|
||||
const domainIndex = link.href.indexOf('//') + 2;
|
||||
let domainIndex = link.href.indexOf('www');
|
||||
if (domainIndex !== -1 && domainIndex < 9) {
|
||||
domainIndex += 4;
|
||||
} else {
|
||||
domainIndex = link.href.indexOf('//') + 2;
|
||||
}
|
||||
|
||||
if ((link.classList.value.indexOf('external-link') === -1)
|
||||
&& domainIndex !== 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue