ykdojo / editdojo

(I'm no longer working on this - currently working on https://github.com/ykdojo/defaang)
https://www.csdojo.io/edit
MIT License
332 stars 98 forks source link

Added text difference finder #25

Closed franktzheng closed 5 years ago

franktzheng commented 5 years ago

I used the longest common subsequence algorithm to create a text difference finder. I added the Javascript and CSS into a global static folder, which I registered in settings.py.

The text difference finder is in text_difference.js and can be called with the function findTextDifference(). The function returns an array of 3 strings: one that shows the deletions and additions, one that shows only the deletions, and one that shows only the additions. Each string is formatted using a span element with either a "deleted" or "added" class.

ykdojo commented 5 years ago

Thanks! I'll take a look at this asap. (maybe after I publish my next video this weekend)

ykdojo commented 5 years ago

Hi, FYI, I just added the MIT license to this project.

Just wanted to let you know about it since this pull request might be the first major PR that's not made by me.

ykdojo commented 5 years ago

Okay, I might change the function to my version later, but the whole layout of this PR is really helpful. So, I'll merge it for now and probably change the implementation a bit later.