chore: Modify logics converting xml doc comment to markdown #10855
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR intended to fix issue #10553.
Background
Markdown can mix
HTML Blockinside markdown content.When mix
HTML Blockinside markdown.It need to add
Empty LinebetweenHTML Elementand markdown content to parse HTML Block correctly.(CommonMark Spec
What's changed in this PR
1.
XmlComment.Extensions.csAdd partial class that definition of
GetMarkdownTextmethod and related helper methods/fields.GetMarkdownTextmethod returns markdown that insert EmptyLine before/after HTMLBlock when required.2.
XmlComment.csXPathNavigatorto useXDocumentinstead.<pre>and preserving indent.(These logics are moved to
GetMarkdownTextmethod)3.
XmlCommentTest.*.csAdd test patterns for XML->Markdown conversion.
Update Snapshots
Snapshot files are updated by
snapshot.ymland following changes applied.Extra
\nis added atdescriptioncontent. ([It's caused by new line is inserted before<para>tagEmpty 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)