Skip to content

Render identical strings instead of returning null #78

@mansoorkhan96

Description

@mansoorkhan96

First of all, Thank you so much for working on this amazing package ❤️

I am working on a Versioning plugin that shows the diff for fields like title, content.

Its inspired by WordPress Revisioning system.

Is there any option in this package to render the identical strings as they are instead of returning null. Just like WordPress, it renders both the string as they were not changed.

Here is work around we are using in a package:

if ($old === $new) {
    $diff[$key] = '<table class="diff-wrapper diff diff-html diff-side-by-side"><tbody class="change change-eq"><tr><td class="old">'.$old.'</td><td class="new">'.$new.'</td></tr></tbody></table>';
} else {
    $diff[$key] = str_replace('\n No newline at end of file', '', DiffHelper::calculate($old, $new, $renderer, $differOptions, $renderOptions));
}

Default behaviour of the package is fine. But i wish there is a way to render above by passing a render option maybe?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions