Skip to content

Same comments create a diff. #25

@SebastianStehle

Description

@SebastianStehle

Bug Report

Prerequisites

  • Can you reproduce the problem in a MWE?
  • Are you running the latest version of AngleSharp?
  • Did you check the FAQs to see if that helps you?
  • Are you reporting to the correct repository? (there are multiple AngleSharp libraries, e.g., AngleSharp.Css for CSS support)
  • Did you perform a search in the issues?

For more information, see the CONTRIBUTING guide.

Description

When I compare two comments a diff is created.

Steps to Reproduce

using AngleSharp.Diffing;
using AngleSharp.Diffing.Strategies.AttributeStrategies;
using AngleSharp.Diffing.Strategies.TextNodeStrategies;

var comment = "<!-- [endif] -->";

var diffs =
    DiffBuilder
        .Compare(comment)
        .WithTest(comment)
        .WithOptions(options => options
            .AddAttributeComparer()
            .AddAttributeNameMatcher()
            .AddBooleanAttributeComparer(BooleanAttributeComparision.Strict)
            .AddClassAttributeComparer()
            .AddCssSelectorMatcher()
            .AddElementComparer()
            .AddIgnoreElementSupport()
            .AddSearchingNodeMatcher()
            .AddStyleAttributeComparer()
            .AddStyleSheetComparer()
            .AddTextComparer(WhitespaceOption.Normalize, ignoreCase: false)
            .IgnoreDiffAttributes()
        )
        .Build();

Console.WriteLine(diffs.Count());

Shows one diff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions