Skip to content

Commit b7560ba

Browse files
authored
Update NavigationPrefixChecker to skip phantom paths during link resolution. (#1418)
We need to do this on both branches as otherwise it requires a certain order for phantom branches to not be validated.
1 parent 032257f commit b7560ba

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/tooling/docs-assembler/Links/NavigationPrefixChecker.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private async Task FetchAndValidateCrossLinks(DiagnosticsCollector collector, st
9898

9999
// Todo publish all relative folders as part of the link reference
100100
// That way we don't need to iterate over all links and find all permutations of their relative paths
101-
foreach (var (relativeLink, _) in linkReference.Links)
101+
foreach (var (relativeLink, linkMetadata) in linkReference.Links)
102102
{
103103
var navigationPaths = _uriResolver.ResolveToSubPaths(new Uri($"{repository}://{relativeLink}"), relativeLink);
104104
foreach (var navigationPath in navigationPaths)
@@ -116,6 +116,9 @@ private async Task FetchAndValidateCrossLinks(DiagnosticsCollector collector, st
116116
}
117117
else
118118
{
119+
if (_phantoms.Count > 0 && _phantoms.Contains(new Uri($"{repository}://{navigationPath}")))
120+
continue;
121+
119122
dictionary.Add(navigationPath, new SeenPaths
120123
{
121124
Repository = repository,

0 commit comments

Comments
 (0)