Skip to content

Diff is working weird in some scenarios? #59

@hmarcelodn

Description

@hmarcelodn

Hello,

We are experiencing a really weird behaviour with the following example:

const Diff3 = require('node-diff3');

const templateA = `
$capitalize($possessive([q#3])) Security Policies and Procedures were adopted as of (Date) by
`;

const templateB = `
$capitalize($possessive([q#3])) Security Policies and Procedures were adopted as of [Date] by

123
`;

const original = `
$capitalize($possessive([q#3])) Security Policies and Procedures were adopted as of (Date) by
`

const diffOutput = Diff3.diff3Merge(templateA, original, templateB, { stringSeparator: '\n' });
console.log(diffOutput[0].ok.join('\n'));
console.log(diffOutput);

My expectation from the code above is to get:

$capitalize($possessive([q#3])) Security Policies and Procedures were adopted as of (Date) by

123

However I am getting:

$capitalize($possessive([q#3])) Security Policies and Procedures were adopted as of [Date] by

123

Notice the parenthesis is not being applied to my [Date] piece. Any clue on what's happening? I am expecting to get a conflict but its not happening.

Thanks in advanced.

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