TLF 2.0 Bullets in editor
Hi All,
I am currently developing an editor with the new TLF 2.0. Everything is working fine except the bullet's functionality.
The goal is to use the bullets dynamically with different selected paragraphs.
Could you please tell me if I can implement a simple solution using ListElement and ListItemElement considering all the different cases ? It seems to be quite difficult and tedious.
For instance, the new tlf 2.0 will use 'ul' and 'li' html tags in order to create the bullets. I would need to check when the 'ul' and 'li' start and end according to the user selection.
One of these cases would be for example :
- test 1
- test 2
- test 3
with : <ul><li>test 1</li><li>test 2</li><li>test 3</li></ul>
Then, the user selects text 2 and undo the bullet :
- test 1
test 2
- test 3
with : <ul><li>test 1</li></ul>test 2<ul><li>test 3</li></ul>
I need to calculate indexes of the first ListElement, the paragraph and the second ListElement in order to recreate a proper list.
Is there a simple way to implement this example and all the other cases ?
Has someone already implemented a similar solution : a dynamic bullet functionality for a rich text editor using ListElement and ListItemElement ?
Thanks a lot for your tips and help.
Regards,
MC
