[Question] How to add "Ordered/Unordered List" option in rte/custom block
See original GitHub issueHi
I’m trying to create an ordered list with grapesjs. I tried adding the following to the rte:
editor.RichTextEditor.add('orderedList',
{
icon: '1.',
attributes: {title: 'Ordered List'},
result: rte => rte.exec('insertOrderedList')
});
And this works if my page is pre-filled with html when the editor is initialized, like below:
Prefilled Editor:
Create Ordered List:
If, however, I drop a new block into the canvas, and then press the ordered list button, I get a NS_ERROR_ILLEGAL_VALUE message, like below:
Create new Paragraph Block:
Create Ordered List:
How can I fix this so that:
- we can insert lists in newly created blocks? (Side Note: My example shows me doing this through the rte toolbar, but I am open to making lists into a new block type, if that helps and someone can tell me how to make them work.)
- we can indent lists to create multilevel bullets (currently the indent command via the rte also does not work on new blocks, possibly for the same reasons above)
- (Optionally) we can use the tab key to indent the lists?
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
How to add an alpha ordered list option in Redactor?
I am able to add custom formatting (with formattingAdd ) to create <ol class="my-class"></ol> , but I haven't found a way to allow...
Read more >HTML Bullet Points – How to Create an Unordered List with ...
You create an unordered list using the ul tag. Then, you use the li tag to list each and every one of the...
Read more >jquery - How to add a list item to an existing unordered list
This would do it: $("#header ul").append('<li><a href="/user/messages"><span class="tab">Message Center</span></a></li>');. Two things:.
Read more >Styling lists - Learn web development | MDN
Throughout this article, we'll look at unordered, ordered, and description lists — all have styling features that are similar, as well as ...
Read more >HTML Unordered Lists - W3Schools
Chapter Summary · Use the HTML <ul> element to define an unordered list · Use the CSS list-style-type property to define the list...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
From the above comments, I can now add ordered and unordered list. Is there any way to update existing ordered and unordered List ?
@artf @rahuloftheramaneffect
This seems to be a problem with de P tag. With the default text inside the div, works fine in firefox.