Skip to content

Commit

Permalink
Used non-escaped text from XML doc summary for descriptions (#7563)
Browse files Browse the repository at this point in the history
  • Loading branch information
glen-84 authored and michaelstaib committed Oct 7, 2024
1 parent bc1148e commit 32b8fb0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,13 @@ private static void AppendText(

foreach (var node in element.Nodes())
{
var currentElement = node as XElement;
if (currentElement is null)
if (node is not XElement currentElement)
{
description.Append(node);
if (node is XText text)
{
description.Append(text.Value);
}

continue;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
namespace HotChocolate.Types.Descriptors
{
/// <summary>
/// I am a test class.
/// </summary>
public class ClassWithSummary
{
}
}
namespace HotChocolate.Types.Descriptors;

/// <summary>
/// I am a test class. This should not be escaped: >
/// </summary>
public class ClassWithSummary;
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ public void When_class_has_description_then_it_is_converted()
typeof(ClassWithSummary));

// assert
Assert.Equal("I am a test class.", description);
Assert.Equal("I am a test class. This should not be escaped: >", description);
}

[Fact]
Expand Down

0 comments on commit 32b8fb0

Please sign in to comment.