Skip to content

Commit

Permalink
Small bug fix for link generation in CodeAnalysis module for nested t…
Browse files Browse the repository at this point in the history
…ypes
  • Loading branch information
daveaglick committed Oct 7, 2016
1 parent c5499f9 commit 69c90ee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/extensions/Wyam.CodeAnalysis/AnalyzeCSharp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,12 @@ private FilePath DefaultWritePath(IMetadata metadata, DirectoryPath prefix)
{
// Members output to a page equal to their SymbolId under the folder for their type
IDocument containingTypeDocument = metadata.Get<IDocument>(CodeAnalysisKeys.ContainingType, null);
writePath = new FilePath(containingTypeDocument?.FilePath(Keys.WritePath).FullPath.Replace("index.html", metadata.String(CodeAnalysisKeys.SymbolId) + ".html"));
string containingPath = containingTypeDocument.FilePath(Keys.WritePath).FullPath;
if (prefix != null && containingPath.StartsWith(prefix.FullPath + "/"))
{
containingPath = containingPath.Substring(prefix.FullPath.Length + 1);
}
writePath = new FilePath(containingPath.Replace("index.html", metadata.String(CodeAnalysisKeys.SymbolId) + ".html"));
}

// Add the prefix
Expand Down

0 comments on commit 69c90ee

Please sign in to comment.