Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prohibit list nesting #3501

Closed
hjagodzinski opened this issue Feb 22, 2017 · 4 comments
Closed

Prohibit list nesting #3501

hjagodzinski opened this issue Feb 22, 2017 · 4 comments

Comments

@hjagodzinski
Copy link

hjagodzinski commented Feb 22, 2017

Do you want to request a feature or report a bug?
bug

What is the current behavior?

I want to limit HTML to given subset defining valid_children: '-h1[b],-h2[b],-li[h1|h2|ul|ol],-ul[ul|ol],-ol[ul|ol]'.

Provided this configuration it's possible to create nested list with TAB key and by pasting it from already existing HTML. Here is an example of a nested list:

  • Coffee
  • Tea
    • Black tea
    • Green tea
    • Green tea
  • Milk

**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via fiddle.tinymce.com or similar.

demo

What is the expected behavior?

It's not possible to create a nested list by a TAB key or by pasting it from already existing HTML. The pasting should strip nested list tags (ol, ul, li).

Which versions of TinyMCE, and which browser / OS are affected by this issue? Did this work in previous versions of TinyMCE?

I was able to reproduce it with various 4.* versions.

@tinesoft
Copy link

tinesoft commented Oct 5, 2022

Hi,

Any update on this? Have you found a fix/workaround @hjagodzinski ?

I have the exact same problem, restrictions expressed by valid_children are not taken into account...
Tested on v5.10 and v6 of TinyMCE, no success...

@tinesoft
Copy link

tinesoft commented Oct 7, 2022

Update :

Provided this configuration it's possible to create nested list with TAB key

For that part, you can set the option lists_indent_on_tab (from lists plugin) to false to prevent creating nested lists by pressing TAB on an existing list item

But still, the current config valid_children: '-li[h1|h2|ul|ol],-ul[ul|ol],-ol[ul|ol]'. still does NOT prevent nesting lists through Copy-Paste into the editor....
The reason is certainly because the internal Schema add this explicitly:

addValidChildren('+ol[ul|ol],+ul[ul|ol]');

@tiny-stale-bot
Copy link
Collaborator

This issue is stale because it has been open 365 days with no activity. Please comment if you wish to keep this issue open or it will be closed in 30 days.

@tiny-stale-bot
Copy link
Collaborator

This issue was closed because it has been stalled for 30 days with no activity.

@tiny-stale-bot tiny-stale-bot closed this as not planned Won't fix, can't repro, duplicate, stale Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants