From 7721b03f1aba13acd5807075a88518d64ae3dc07 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 21 May 2025 09:29:29 +0000 Subject: [PATCH 1/3] Initial plan for issue From 0745c3eb8e3fbba28de9d75fc6587905017cc474 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 27 May 2025 03:06:31 +0000 Subject: [PATCH 2/3] Fix list rendering in XML remarks sections Co-authored-by: yufeih <511355+yufeih@users.noreply.github.com> --- src/Docfx.Dotnet/Parsers/XmlComment.cs | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/Docfx.Dotnet/Parsers/XmlComment.cs b/src/Docfx.Dotnet/Parsers/XmlComment.cs index 5e736979005..04730423d57 100644 --- a/src/Docfx.Dotnet/Parsers/XmlComment.cs +++ b/src/Docfx.Dotnet/Parsers/XmlComment.cs @@ -586,13 +586,23 @@ private static string TrimEachLine(string text, string indent = "") private static string GetInnerXmlAsMarkdown(string xml) { - if (!xml.Contains('&')) - return xml; - xml = HandleBlockQuote(xml); - var pipeline = new MarkdownPipelineBuilder().UseMathematics().EnableTrackTrivia().Build(); + + // Configure the Markdown pipeline to properly handle lists + var pipeline = new MarkdownPipelineBuilder() + .UseMathematics() + .EnableTrackTrivia() + .Configure(extensions: "advanced-tasklists-noindentcodeblock") // Disable indented code blocks + .Build(); + var markdown = Markdown.Parse(xml, pipeline); - MarkdownXmlDecode(markdown); + + // Only process XML entities if they exist in the content + if (xml.Contains('&')) + { + MarkdownXmlDecode(markdown); + } + var sw = new StringWriter(); var rr = new RoundtripRenderer(sw); rr.ObjectRenderers.Add(new MathInlineRenderer()); From ae55894d19edcb502248b377ef74a2b10f3b34ec Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 27 May 2025 07:26:48 +0000 Subject: [PATCH 3/3] Add test case for list rendering in XML remarks sections Co-authored-by: yufeih <511355+yufeih@users.noreply.github.com> --- test/Docfx.Dotnet.Tests/XmlCommentUnitTest.cs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/Docfx.Dotnet.Tests/XmlCommentUnitTest.cs b/test/Docfx.Dotnet.Tests/XmlCommentUnitTest.cs index 9906c514222..838ffc249d9 100644 --- a/test/Docfx.Dotnet.Tests/XmlCommentUnitTest.cs +++ b/test/Docfx.Dotnet.Tests/XmlCommentUnitTest.cs @@ -575,6 +575,42 @@ public sealed class Issue10385 """, comment.Remarks, ignoreLineEndingDifferences: true); } + [Fact] + public void Issue10559() + { + var comment = XmlComment.Parse( + """ + + Test para + + Test start list + + + Item 1. + + + Item 2. + + + Test end list + + + """); + Assert.Equal( + """ +

Test para

+ + Test start list + + Test end list + + """, comment.Remarks, ignoreLineEndingDifferences: true); + } + }