Skip to content

Commit 9713d34

Browse files
committed
rename hostname parameter
1 parent 2ae4a86 commit 9713d34

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/utilities/src/utilities.client.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,17 +158,17 @@ export function normalizeUrl(url: string, keepFragment?: boolean) {
158158
}
159159

160160
// Helper function for markdown rendered marked
161-
// If passed hostname, it renders links outside that hostname in readme with rel="noopener noreferrer" and target="_blank" attributes
161+
// If passed referrerHostname, it renders links outside that hostname in readme with rel="noopener noreferrer" and target="_blank" attributes
162162
// And links outside apify.com in readme with rel="noopener noreferrer nofollow" and target="_blank" attributes
163-
export function markedSetNofollowLinks(href: string, title: string, text: string, hostname?: string) {
163+
export function markedSetNofollowLinks(href: string, title: string, text: string, referrerHostname?: string) {
164164
let urlParsed: URL;
165165
try {
166166
urlParsed = new URL(href);
167167
} catch (e) {
168168
// Probably invalid url, go on
169169
}
170170
const isApifyLink = (urlParsed! && /(\.|^)apify\.com$/i.test(urlParsed.hostname));
171-
const isSameHostname = !hostname || (urlParsed! && urlParsed.hostname === hostname);
171+
const isSameHostname = !referrerHostname || (urlParsed! && urlParsed.hostname === referrerHostname);
172172

173173
if (isApifyLink && isSameHostname) {
174174
return `<a href="${href}">${title || text}</a>`;

0 commit comments

Comments
 (0)