55using System ;
66using System . Collections . Generic ;
77using System . Threading . Tasks ;
8+ using Elastic . Documentation . Links ;
89using Elastic . Documentation . Site . Navigation ;
910using Elastic . Markdown . Links . CrossLinks ;
1011
@@ -29,7 +30,7 @@ public static async Task ValidateNavigationCrossLinksAsync(
2930 {
3031 var url = crossLinkItem . Url ;
3132 if ( url != null && Uri . TryCreate ( url , UriKind . Absolute , out var crossUri ) &&
32- crossUri . Scheme != "http" && crossUri . Scheme != "https" )
33+ CrossLinkValidator . IsCrossLink ( crossUri ) )
3334 {
3435 // Try to resolve the cross-link URL
3536 if ( crossLinkResolver . TryResolve ( errorEmitter , crossUri , out var resolvedUri ) )
@@ -47,8 +48,7 @@ public static async Task ValidateNavigationCrossLinksAsync(
4748 else if ( item is FileNavigationItem fileItem &&
4849 fileItem . Url != null &&
4950 Uri . TryCreate ( fileItem . Url , UriKind . Absolute , out var fileUri ) &&
50- fileUri . Scheme != "http" &&
51- fileUri . Scheme != "https" )
51+ CrossLinkValidator . IsCrossLink ( fileUri ) )
5252 {
5353 // Cross-link URL detected in a FileNavigationItem, but we're not validating it yet
5454 }
@@ -67,8 +67,7 @@ private static List<INavigationItem> FindNavigationItemsWithCrossLinks(INavigati
6767 var url = crossLinkItem . Url ;
6868 if ( url != null &&
6969 Uri . TryCreate ( url , UriKind . Absolute , out var uri ) &&
70- uri . Scheme != "http" &&
71- uri . Scheme != "https" )
70+ CrossLinkValidator . IsCrossLink ( uri ) )
7271 {
7372 results . Add ( item ) ;
7473 }
0 commit comments