Skip to content

Commit 1ae0edf

Browse files
authored
Ignore links that contain tags/images in applyToLink (#30)
1 parent 8c968cc commit 1ae0edf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ function applyToLink(a, currentUrl) {
187187
// Shorten only if the link name hasn't been customized.
188188
// .href automatically adds a / to naked origins so that needs to be tested too
189189
// `trim` makes it compatible with this feature: https://github.com/sindresorhus/refined-github/pull/3085
190-
if (a.href === a.textContent.trim() || a.href === `${a.textContent}/`) {
190+
if ((a.href === a.textContent.trim() || a.href === `${a.textContent}/`) && !a.firstElementChild) {
191191
const shortened = shortenURL(a.href, currentUrl);
192192
a.innerHTML = shortened;
193193
return true;

0 commit comments

Comments
 (0)