Skip to content

Conversation

@filzrev
Copy link
Contributor

@filzrev filzrev commented Oct 23, 2025

This PR intended to fix issue #10553.

Background

Markdown can mix HTML Block inside markdown content.
When mix HTML Block inside markdown.
It need to add Empty Line between HTML Element and markdown content to parse HTML Block correctly.
(CommonMark Spec

What's changed in this PR

1. XmlComment.Extensions.cs

Add partial class that definition of GetMarkdownText method and related helper methods/fields.
GetMarkdownText method returns markdown that insert EmptyLine before/after HTMLBlock when required.

2. XmlComment.cs

  • Replace XPathNavigator to use XDocument instead.
  • Remove temporary workaround logics to insert new line before <pre> and preserving indent.
    (These logics are moved to GetMarkdownText method)
  • Cleanup existing code.

3. XmlCommentTest.*.cs

Add test patterns for XML->Markdown conversion.

Update Snapshots

Snapshot files are updated by snapshot.yml and following changes applied.

  • Extra \n is added at description content. ([It's caused by new line is inserted before <para> tag

  • Empty line inserted before <pre>,<ul>,<table>,<p> tag when previous node is markdown content.
    (If prev node is HTML element. empty line is not added)

@filzrev filzrev force-pushed the fix-xml-comment-parse-behavior branch from 6f70154 to 41e735c Compare October 23, 2025 04:20
@filzrev filzrev force-pushed the fix-xml-comment-parse-behavior branch from 41e735c to 407a4e6 Compare October 23, 2025 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant