Skip to content
Permalink
Browse files

Merge pull request #733 from designxsteph/doc-issues

(GH-732) Fix broken doc links
  • Loading branch information
ferventcoder committed Nov 14, 2019
2 parents 84e0dae + 2da1f00 commit 86cb6c83806dc593e79b3ffa6885e94de69a3c35
Showing with 12 additions and 1 deletion.
  1. +12 −1 chocolatey/Website/Controllers/DocumentationController.cs
@@ -175,12 +175,23 @@ private string GetUrl(string filePath, string docName = null)
if (string.IsNullOrWhiteSpace(filePath)) return filePath;

var fileName = Path.GetFileNameWithoutExtension(filePath);
if (fileName.Equals("CommandsApiKey"))
{
fileName = fileName.Replace("CommandsApiKey", "CommandsApikey");
}

var hyphenatedValue = new StringBuilder();

Char previousChar = '^';
foreach (var valueChar in fileName)
{
if (Char.IsUpper(valueChar) && hyphenatedValue.Length != 0 && !Char.IsUpper(previousChar))
// Filenames that contain both a "-" and camel casing
if (fileName.Contains("-") && Char.IsLower(previousChar) && Char.IsUpper(valueChar))
{
hyphenatedValue.Append("-");
}

if (Char.IsUpper(valueChar) && hyphenatedValue.Length != 0 && !Char.IsUpper(previousChar) && !fileName.Contains("-"))
{
hyphenatedValue.Append("-");
}

0 comments on commit 86cb6c8

Please sign in to comment.
You can’t perform that action at this time.