Currently inline fragments are merged in case two neighbouring fragments:
- are from the same tool
- the second fragment starts at index where the first one ends
How it should work ideally:
- Two fragments in the fragments array are from the same tool
- The second fragment starts at index where the first one ends
Naive solution would be O(n^2), we should think of more efficient solution