From 2dd7f2053a6a88438b5bdea97ffac311f430c7f6 Mon Sep 17 00:00:00 2001 From: Yufei Huang Date: Mon, 18 Dec 2023 14:58:26 +0800 Subject: [PATCH] test: code in C# documentation comment #9495 (#9536) * test: code in C# documentation comment #9495 * ignoreLineEndingDifferences --- test/Docfx.Dotnet.Tests/XmlCommentUnitTest.cs | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/test/Docfx.Dotnet.Tests/XmlCommentUnitTest.cs b/test/Docfx.Dotnet.Tests/XmlCommentUnitTest.cs index 08a40e9ce7e..698e3b910ab 100644 --- a/test/Docfx.Dotnet.Tests/XmlCommentUnitTest.cs +++ b/test/Docfx.Dotnet.Tests/XmlCommentUnitTest.cs @@ -487,4 +487,47 @@ public void ParseXmlCommentWithoutRootNode() var commentModel = XmlComment.Parse(input, new XmlCommentParserContext()); Assert.Equal("A", commentModel.Summary); } + + [Fact] + public void Issue9495() + { + var comment = XmlComment.Parse( + """ + + + + + """); + Assert.Equal( + """ +
options.UseRelativeLinks = true;
+
{
+              "type": "articles",
+              "id": "4309",
+              "relationships": {
+                 "author": {
+                   "links": {
+                     "self": "/api/shopping/articles/4309/relationships/author",
+                     "related": "/api/shopping/articles/4309/author"
+                   }
+                 }
+              }
+            }
+ """, comment.Examples[0], ignoreLineEndingDifferences: true); + } }