Code Monkey home page Code Monkey logo

Comments (12)

samrm111 avatar samrm111 commented on August 26, 2024 9

👍

from jsdiff.

pedro93 avatar pedro93 commented on August 26, 2024 4

+1 for feature.

Just leaving a note here, the HTML support requested appears to be in essence a tree based diff algorithm which is wildly different from a text-based diff.

There is a relatively old project which does this for xml https://github.com/fdintino/xydiff, I have not searched a long time but perhaps there are newer or even better open-source solutions available.

Perhaps an investigation into it could lead to the feature. Not sure how it can incorporated though.

from jsdiff.

dauletisataev avatar dauletisataev commented on August 26, 2024 2

Any updates on this? @kpdecker

from jsdiff.

mhuebner avatar mhuebner commented on August 26, 2024 1

+1 for HTML support.

from jsdiff.

v1talii-dev avatar v1talii-dev commented on August 26, 2024 1

are there any updates on this issue? can someone find a workaround?

from jsdiff.

kpdecker avatar kpdecker commented on August 26, 2024

@unkw I need more explanation. For the input above, what do you want it to return as the changes?

from jsdiff.

unkw avatar unkw commented on August 26, 2024

I expect the output as:

  • "production" as insert
  • "javascript" as modified (since changed the tag)

from jsdiff.

kpdecker avatar kpdecker commented on August 26, 2024

How are you trying to use this? Just saying "javascript" because the tag changed without providing any information about what the tag that changed was does not seem very useful.

from jsdiff.

unkw avatar unkw commented on August 26, 2024

We have rich text editor. User can change text in editor, can change font from Bold to Italic. And i need show diff what was deleted in the text, what was modified or inserted.

from jsdiff.

unkw avatar unkw commented on August 26, 2024

@kpdecker will it be possible to realize it?

from jsdiff.

kpdecker avatar kpdecker commented on August 26, 2024

This is a non-trivial thing to implement as it requires more knowledge of the structure of the document than the text focused diff algorithm implemented here allows for. I'm not certain that the algorithms here are good candidates for this as they are currently implemented. That's to say that this won't be implemented in the immediate term but leaving this open to revisit if I or any members of the community have time. I'm glad to accept pull requests that tackle this feature.

from jsdiff.

unkw avatar unkw commented on August 26, 2024

@kpdecker I agree, this is not a trivial task. Thank you for the feedback and this nice library ;)

from jsdiff.

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.