Git Product home page Git Product logo

Comments (5)

delambo avatar delambo commented on August 27, 2024

If you play around with Microsoft Word's track changes, they merge blocks, with the difference that they keep track of block boundaries so you can reject/restore changes.

If it is overly problematic to retain block merging, then I would consider getting rid of it.

from ice.

johanneswilm avatar johanneswilm commented on August 27, 2024

It's not impossible to keep it the way you have it right now. Right now it's there as an option that can be turned on or off.
But the question is what to do if you delete over a boundary between a list and a p-element. Or an H1-element and a p-element. To me it would seem wrong if the p-element merges into the list or the headline. So I would like to keep it only for merging p-elements with other p-elements or possible always merging equal elements (H1 with H1, ul with ul, ol with ol, etc.) and leavign block boundaries if two elements of different types meet.

I don't know your guys'es usecase that well. It would seem to me that if you do merge blocks, you'd want to keep track of the block boundaries so you can restore them in case you don't like the changes at all (the way you describe MsWord). Is that not a concern?

from ice.

delambo avatar delambo commented on August 27, 2024

Merging was a preference since that is the way MsWord handles when deleting from block to block. Also, if blocks aren't merged, then it forces the implementer to remove empty blocks when cleaning since they will be emptied by ice during cleaning.

It's just a preference and I would be willing to remove it, especially if it introduces a lot of work when we support more blocks.

from ice.

johanneswilm avatar johanneswilm commented on August 27, 2024

Ok, I have added simple tests for deleting images and lists from the left and right and made it all work in Firefox and Webkit. Further tests should be made whenever one comes across a problem, I would think.

I have also removed the mergeBlocks option.

The changes overall are in a few extra functions I have added to dom.js, and in ICE a rewrite of _deleteFromLeft, _deleteFromRight, _deleteFromSelection as well as replacing the _addTextNodeTracking function with an _addNodeTracking function that can cover other things than text nodes. It can be used to move the range, but if you don't hand it a range, it can work with just marking the node for deletion as well. I initially pulled from some earlier trials of getting images and lists to work with ICE, and have then developed that further.

I think it is a good idea to take it piecemeal, but in the case of the rewrite of these functions, one almost has to look at them in their entirety. I have tried to comment as much as possible.

from ice.

delambo avatar delambo commented on August 27, 2024

Closing this since we finished #49 where we decided to remove the block merging.

from ice.

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.