Nested ordered list in tinymce

admin2025-01-07  4

I'm trying to change the behavior of tinymce regarding ordered list (using the plugin advlist), actually if i type an ordered list i've got this html :

<ol>
  <li>first item</li>
  <li>second item</li>
  <li>third item</li>
</ol>

if after my "Title 1" i press two times enter my actual list is split and so i have two differents lists, and i dont want that ...

i want to be able to insert inside my original ordered list another ordered list, like this :

<ol>
  <li>first item</li>
  <li>second item
    <ol>
      <li>second item first subitem</li>
      <li>second item second subitem</li>
      <li>second item third subitem</li>
    </ol>
  </li> 
  <li>third item</li>
</ol>

I find this post it's not what i want to do but it explains how to change keyboard behavior, but i am not able to find how to avoid this auto close ol tag ...

I check a lot of option in tinymce but it doesn't seems to be something i can do using options (end_container_on_empty_block, fix_list_elements etc ...)

how to avoid auto close ol tag when i do a line return ?

I'm trying to change the behavior of tinymce regarding ordered list (using the plugin advlist), actually if i type an ordered list i've got this html :

<ol>
  <li>first item</li>
  <li>second item</li>
  <li>third item</li>
</ol>

if after my "Title 1" i press two times enter my actual list is split and so i have two differents lists, and i dont want that ...

i want to be able to insert inside my original ordered list another ordered list, like this :

<ol>
  <li>first item</li>
  <li>second item
    <ol>
      <li>second item first subitem</li>
      <li>second item second subitem</li>
      <li>second item third subitem</li>
    </ol>
  </li> 
  <li>third item</li>
</ol>

I find this post it's not what i want to do but it explains how to change keyboard behavior, but i am not able to find how to avoid this auto close ol tag ...

I check a lot of option in tinymce but it doesn't seems to be something i can do using options (end_container_on_empty_block, fix_list_elements etc ...)

how to avoid auto close ol tag when i do a line return ?

Share Improve this question edited Feb 8, 2018 at 12:03 Aliiiiiiii asked Feb 7, 2018 at 16:19 AliiiiiiiiAliiiiiiii 1631 silver badge13 bronze badges 2
  • Have you tried pressing "shift enter" or "control enter" instead of just enter? A lot of times that adds a line break without closing tags. – WebElaine Commented Feb 7, 2018 at 16:47
  • "Shift enter" made me stay inside the li tag but i'm not able to insert a new ordered list / "Control enter" has the same behavior as enter alone (one time : create a new item in the current list / two times split my list) – Aliiiiiiii Commented Feb 7, 2018 at 18:06
Add a comment  | 

1 Answer 1

Reset to default 0

Finally (thanks to tinymce forum) i found the answer :

when i'm on "second item" for example just have to click on and that will create a sub-list

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736259044a559.html

最新回复(0)