Coder Social home page Coder Social logo

Comments (1)

NeilFraser avatar NeilFraser commented on May 8, 2024

Unable to recreate. Here are my steps:

Go to:
https://neil.fraser.name/software/diff_match_patch/demos/diff.html
Open console.
Paste your code (simplified a little bit):

        var dm = new diff_match_patch();

        var t1 = 
        "Let's enjoy right here where we at\n" + 
        "Who knows where this road is supposed to lead\n" + 
        "We got nothin' but time\n" + 
        "As long as you're right here next to me\n" + 
        "Everything's gonna be alright\n";

        var t2 = 
        "Let's enjoy right here where we at\n" + 
        "Who knows where this road supposed to lead?\n" + 
        "We got nothin' but time\n" + 
        "As long as you're right here next to me\n" + 
        "Everythin's gonna be alright\n" + 
        "If it's meant to be, it'll be, it'll be\n";

        var d = dm.diff_main(t1, t2);

        var ds = dm.diff_prettyHtml(d);
        console.log(d);
        console.log(ds);

Result:

(8) [d…h.Diff, d…h.Diff, d…h.Diff, d…h.Diff, d…h.Diff, d…h.Diff, d…h.Diff, d…h.Diff]
<span>Let's enjoy right here where we at&para;<br>Who knows where this road </span><del style="background:#ffe6e6;">is </del><span>supposed to lead</span><ins style="background:#e6ffe6;">?</ins><span>&para;<br>We got nothin' but time&para;<br>As long as you're right here next to me&para;<br>Everythin</span><del style="background:#ffe6e6;">g</del><span>'s gonna be alright&para;<br></span><ins style="background:#e6ffe6;">If it's meant to be, it'll be, it'll be&para;<br></ins>

I don't see an error. Please reopen this bug if you are still having problems.

from diff-match-patch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.