Closed SebastianStehle closed 1 year ago
Thanks, I have fixed the XML comments.
Two more things:
Feel free to write the markdown here in the PR as a comment and I will move it over to the wiki page. My plan is to drop using the wiki and move the content into a docs folder so that the docs can be in sync with the code.
Added the changelog.
Here is my stuff for the wiki
--
The element closing compare strategy will simply check if both nodes are elements and if the elements are closed the same way. If you add this comparer, <br />
and <br>
are marked as different.
This comparer is not part of the default options. To choose this comparer, use the AddElementClosingComparer() method on the IDiffingStrategyCollection type, e.g.:
var diffs = DiffBuilder
.Compare(controlHtml)
.WithTest(testHtml)
.WithOptions(options => options.AddElementClosingComparer())
.Build();
Btw: It is not optimal that I cannot add metadata to the diff. In this case, I think you don't know why there is a diff. Btw: Can you push it to nuget today?
Btw: It is not optimal that I cannot add metadata to the diff. In this case, I think you don't know why there is a diff. Btw: Can you push it to nuget today?
Yeah, we could consider adding a way to report more back than just a CompareResult
. A workaround you can employ is to cast IDiff
to NodeDiff
, which has a reference to the Control
and Test
nodes, and that will allow you to inspect the nodes themselves and that way determine if it is a closing tag difference, the same way that the new comparer you have created does it.
Just waiting for @FlorianRappl's take on setting IsKeepingSourceReferences = true
to true before merging.
If you are in a hurry @SebastianStehle, just create a local version of HtmlDiffer in your own project.
Types of Changes
Prerequisites
Please make sure you can check the following two boxes:
Contribution Type
What types of changes does your code introduce? Put an
x
in all the boxes that apply:Description
Closes #30,#31