File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -293,7 +293,10 @@ module.exports = {
293293 remarkStringify : {
294294 handlers : {
295295 link : ( node ) => {
296- const isUrlInternal = isInternal ( parse ( node . url ) ) ;
296+ if ( node . title ?. startsWith ( 'Direct link to' ) ) return null ;
297+
298+ const parsedUrl = parse ( node . url ) ;
299+ const isUrlInternal = isInternal ( parsedUrl ) ;
297300 const url = isUrlInternal ? `${ config . absoluteUrl } ${ node . url } .md` : node . url ;
298301
299302 if ( node . title ) return `[${ node . title } ](${ url } )` ;
Original file line number Diff line number Diff line change @@ -2,16 +2,13 @@ const { parse } = require('node:url');
22
33const visit = import ( 'unist-util-visit' ) . then ( ( m ) => m . visit ) ;
44
5- const internalUrls = [ 'docs.apify.com' ] ;
5+ const internalUrl = 'docs.apify.com' ;
66
77/**
88 * @param {import('url').UrlWithStringQuery } href
99 */
1010exports . isInternal = ( href ) => {
11- return internalUrls . some (
12- ( internalUrl ) => href . host === internalUrl
13- || ( ! href . protocol && ! href . host && ( href . pathname || href . hash ) ) ,
14- ) ;
11+ return href . host === internalUrl || ( ! href . protocol && ! href . host && ( href . pathname || href . hash ) ) ;
1512} ;
1613
1714/**
You can’t perform that action at this time.
0 commit comments