|
|
@ -106,14 +106,19 @@ export default class StatusContent extends React.PureComponent { |
|
|
|
link.setAttribute('title', link.href); |
|
|
|
link.setAttribute('title', link.href); |
|
|
|
link.classList.add('unhandled-link'); |
|
|
|
link.classList.add('unhandled-link'); |
|
|
|
|
|
|
|
|
|
|
|
if (tagLinks && isLinkMisleading(link)) { |
|
|
|
try { |
|
|
|
// Add a tag besides the link to display its origin
|
|
|
|
if (tagLinks && isLinkMisleading(link)) { |
|
|
|
|
|
|
|
// Add a tag besides the link to display its origin
|
|
|
|
const tag = document.createElement('span'); |
|
|
|
|
|
|
|
tag.classList.add('link-origin-tag'); |
|
|
|
const tag = document.createElement('span'); |
|
|
|
tag.textContent = `[${new URL(link.href).host}]`; |
|
|
|
tag.classList.add('link-origin-tag'); |
|
|
|
link.insertAdjacentText('beforeend', ' '); |
|
|
|
tag.textContent = `[${new URL(link.href).host}]`; |
|
|
|
link.insertAdjacentElement('beforeend', tag); |
|
|
|
link.insertAdjacentText('beforeend', ' '); |
|
|
|
|
|
|
|
link.insertAdjacentElement('beforeend', tag); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (TypeError) { |
|
|
|
|
|
|
|
// Just to be safe
|
|
|
|
|
|
|
|
if (tagLinks) link.removeAttribute('href'); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|