Skip to content

Why my test result is always wrong? #68

Description

@argb

$a = "<span>abcd</span>";
$b = 'abcd';
$diffConfig = new HtmlDiffConfig();
$diffConfig->setEncoding('UTF-8');
$diff = HtmlDiff::create($a, $b, $diffConfig);

    $diffResult = $diff->build();
    dump($diffResult);

the result is <ins class="mod">abcd</span>
But it should be same. :)

If I change it to below, except the wrong result, the close tag lost also.
$a = '<span>你好</span>';
$b = '你好';
$diffConfig = new HtmlDiffConfig();
$diffConfig->setEncoding('UTF-8');
$diff = HtmlDiff::create($a, $b, $diffConfig);

    $diffResult = $diff->build();

<ins class="mod"><ins class="diffmod"></ins>你好</span>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions