ianstormtaylor / slate

A completely customizable framework for building rich text editors. (Currently in beta.)
http://slatejs.org
MIT License
29.97k stars 3.25k forks source link

insertFragment run inconsistency for large fragment #261

Closed joehua87 closed 8 years ago

joehua87 commented 8 years ago

These 2 output run by 1 code: https://github.com/joehua87/slate/blob/master/test/transforms/fixtures/insert-fragment/large-block/output.json and https://github.com/joehua87/slate/blob/master/test/transforms/fixtures/insert-fragment/large-block/output-1.json

ianstormtaylor commented 8 years ago

Hey @joehua87 can you explain the issue you're running into here more? It would go a long way towards making it easier to resolve. Thanks

joehua87 commented 8 years ago

Hey @ianstormtaylor this is the step to reproduce the error:

You will see the inconsistence pasted result First, I thought it was caused by html serializer but finally find out that it was caused by insertFragment function. So I've created the test fixture for insertFragment (see here https://github.com/joehua87/slate/tree/master/test/transforms/fixtures/insert-fragment/large-block), And it returned difference output each time (For example, you can see output.json & output-1.json)

ianstormtaylor commented 8 years ago

@joehua87 thanks for the info! That's perfect. I'll check this out

ianstormtaylor commented 8 years ago

@joehua87 or @cobbweb could one of you make a PR with a test case that fails inconsistently (but sometimes succeeds if that's the case) and I can check it out? Thanks!

joehua87 commented 8 years ago

@ianstormtaylor I've created the new test for the error case at https://github.com/joehua87/slate for you to easy diagnosis

Please tell me if something is not clear or thing I could do to make you do faster. :)

ianstormtaylor commented 8 years ago

Woot, happy to report that @somus's pull request https://github.com/ianstormtaylor/slate/pull/322 fixed this issue!