Skip to content

DiffWordswithspace - space insertion not labelled correctly #639

@aafreenrah

Description

@aafreenrah

const inputText = "the sunshines on the room.";
const outputText = "the sun shines on the room.";

[
{ count: 2, added: false, removed: false, value: 'the ' },
{ count: 1, added: false, removed: true, value: 'sunshines' },
{ count: 1, added: true, removed: false, value: 'sun' },
{ count: 1, added: false, removed: false, value: ' ' },
{ count: 2, added: true, removed: false, value: 'shines ' },
{ count: 6, added: false, removed: false, value: 'on the room.' }
]

the 4th item should be "added" true from my point of view. I have tried diffwords and diffchars, those results are correct. But I need to use diffwordswithspace for my usecase to track all the insertions and deletions (even a space)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions