diff --git a/modules/ROOT/pages/8.0-release-notes.adoc b/modules/ROOT/pages/8.0-release-notes.adoc index dff80962e6..9d4b6944f1 100644 --- a/modules/ROOT/pages/8.0-release-notes.adoc +++ b/modules/ROOT/pages/8.0-release-notes.adoc @@ -237,6 +237,35 @@ In previous versions of {productname}, the editor's resize handle lacked a `role In {productname} {release-version}, the resize handle now includes a `role` seperator and an `aria-valuetext` attribute that dynamically reflects the current dimensions of the editor. These improvements enhance accessibility and ensure more accurate announcements by screen readers. +=== New `list_max_depth` option to limit list indentation +// #TINY-11937 + +{productname} {release-version} introduced a new `list_max_depth` option that allows configuration of the maximum indent depth for list items. This setting accepts a non-negative integer value, where `0` permits list creation without any indentation, and higher values set the maximum allowable indent depth. Negative values are invalid and will trigger an error. When the option is not set, list behavior remains unchanged. + +The setting applies only to list indentation and does not affect paragraph indentation. Existing content is not altered, and pasted lists that exceed the maximum indent depth will retain their structure but cannot be further indented. When multiple list items are selected, only items eligible for indentation will be indented individually—validation is applied per item, not across the full selection. + +Outdent functionality remains unaffected and always available. The state of indent and outdent controls reflects the current indentation capabilities based on this setting. + +==== Example configuration + +The following example shows a basic configuration for the `list_max_depth` option, which limits list indentation to a maximum of 2 levels: + +[source,js] +---- +tinymce.init({ + selector: "textarea", + plugins: [ + "advlist", "anchor", "autolink", "charmap", "code", "fullscreen", + "help", "image", "insertdatetime", "link", "lists", "media", + "preview", "searchreplace", "table", "visualblocks", + ], + list_max_depth: 2, + toolbar: "undo redo | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", +}); +---- + +For more information, see: xref:user-formatting-options.adoc#list_max_depth[User formatting - List max depth]. + === The translate API now automatically replaces three dots in a row with an ellipsis character. // #TINY-12155 diff --git a/modules/ROOT/pages/user-formatting-options.adoc b/modules/ROOT/pages/user-formatting-options.adoc index f1cb37ecb5..14bfd0b74a 100644 --- a/modules/ROOT/pages/user-formatting-options.adoc +++ b/modules/ROOT/pages/user-formatting-options.adoc @@ -25,3 +25,5 @@ include::partial$configuration/style_formats_autohide.adoc[] include::partial$configuration/style_formats_merge.adoc[] include::partial$configuration/text_color.adoc[] + +include::partial$configuration/list_max_depth.adoc[] diff --git a/modules/ROOT/partials/configuration/list_max_depth.adoc b/modules/ROOT/partials/configuration/list_max_depth.adoc new file mode 100644 index 0000000000..3bb2ea916c --- /dev/null +++ b/modules/ROOT/partials/configuration/list_max_depth.adoc @@ -0,0 +1,24 @@ +[[list_max_depth]] +== `list_max_depth` + +The `list_max_depth` option sets the maximum nesting depth for lists (ordered and unordered). + +*Type:* `Number` + +*Default value:* No limit + +=== Required plugins + +This option requires the `lists` plugin to be enabled. + +=== Example + +[source,js] +---- +tinymce.init({ + selector: 'textarea', + plugins: 'lists', + toolbar: 'bullist numlist', + list_max_depth: 2 // limits list nesting to maximum of 2 levels +}); +----