Skip to content

Commit

Permalink
Fix bug that content of csharp and vb show at the same time
Browse files Browse the repository at this point in the history
  • Loading branch information
qinezh committed Jun 22, 2016
1 parent 6164c5c commit 2c8bfce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ public static List<ApiLanguageValuePair> GetSpecNames(string xref, string[] supp
{
if (specs != null && specs.Count > 0)
{
return specs.Select(kv => new ApiLanguageValuePair() { Language = kv.Key, Value = GetSpecName(kv.Value) }).ToList();
return specs.Where(kv => supportedLanguages.Contains(kv.Key)).Select(kv => new ApiLanguageValuePair() { Language = kv.Key, Value = GetSpecName(kv.Value) }).ToList();
}
if (!string.IsNullOrEmpty(xref))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ private static List<ApiLanguageValuePair> GetContents(string content, string con
if (string.IsNullOrEmpty(content) || supportedLanguages == null || supportedLanguages.Length == 0) return null;

var result = new List<ApiLanguageValuePair>() { new ApiLanguageValuePair() { Language = supportedLanguages[0], Value = content } };
if (!string.IsNullOrEmpty(contentForCSharp)) result.Add(new ApiLanguageValuePair() { Language = "csharp", Value = contentForCSharp });
if (!string.IsNullOrEmpty(contentForVB)) result.Add(new ApiLanguageValuePair() { Language = "vb", Value = contentForVB });
if (!string.IsNullOrEmpty(contentForCSharp) && supportedLanguages.Contains("csharp")) result.Add(new ApiLanguageValuePair() { Language = "csharp", Value = contentForCSharp });
if (!string.IsNullOrEmpty(contentForVB) && supportedLanguages.Contains("vb")) result.Add(new ApiLanguageValuePair() { Language = "vb", Value = contentForVB });
return result;
}
}
Expand Down

0 comments on commit 2c8bfce

Please sign in to comment.