Skip to content

Commit c0f88ff

Browse files
authored
DOC-3147: New list_max_depth option to limit list indentation. (#3766)
* DOC-3147: New list_max_depth option to limit list indentation. * Update modules/ROOT/partials/configuration/list_max_depth.adoc * Update modules/ROOT/pages/8.0-release-notes.adoc
1 parent 7ce213d commit c0f88ff

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

modules/ROOT/pages/8.0-release-notes.adoc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,35 @@ In previous versions of {productname}, the editor's resize handle lacked a `role
237237

238238
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.
239239

240+
=== New `list_max_depth` option to limit list indentation
241+
// #TINY-11937
242+
243+
{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.
244+
245+
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.
246+
247+
Outdent functionality remains unaffected and always available. The state of indent and outdent controls reflects the current indentation capabilities based on this setting.
248+
249+
==== Example configuration
250+
251+
The following example shows a basic configuration for the `list_max_depth` option, which limits list indentation to a maximum of 2 levels:
252+
253+
[source,js]
254+
----
255+
tinymce.init({
256+
selector: "textarea",
257+
plugins: [
258+
"advlist", "anchor", "autolink", "charmap", "code", "fullscreen",
259+
"help", "image", "insertdatetime", "link", "lists", "media",
260+
"preview", "searchreplace", "table", "visualblocks",
261+
],
262+
list_max_depth: 2,
263+
toolbar: "undo redo | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
264+
});
265+
----
266+
267+
For more information, see: xref:user-formatting-options.adoc#list_max_depth[User formatting - List max depth].
268+
240269
=== The translate API now automatically replaces three dots in a row with an ellipsis character.
241270
// #TINY-12155
242271

modules/ROOT/pages/user-formatting-options.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ include::partial$configuration/style_formats_autohide.adoc[]
2525
include::partial$configuration/style_formats_merge.adoc[]
2626

2727
include::partial$configuration/text_color.adoc[]
28+
29+
include::partial$configuration/list_max_depth.adoc[]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[[list_max_depth]]
2+
== `list_max_depth`
3+
4+
The `list_max_depth` option sets the maximum nesting depth for lists (ordered and unordered).
5+
6+
*Type:* `Number`
7+
8+
*Default value:* No limit
9+
10+
=== Required plugins
11+
12+
This option requires the `lists` plugin to be enabled.
13+
14+
=== Example
15+
16+
[source,js]
17+
----
18+
tinymce.init({
19+
selector: 'textarea',
20+
plugins: 'lists',
21+
toolbar: 'bullist numlist',
22+
list_max_depth: 2 // limits list nesting to maximum of 2 levels
23+
});
24+
----

0 commit comments

Comments
 (0)