Skip to content

Commit cd046a0

Browse files
committed
DOC-3147: New list_max_depth option to limit list indentation.
1 parent b3a9cdd commit cd046a0

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

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

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
= {productname} {release-version}
32
:release-version: 8.0.0
43
:navtitle: {productname} {release-version}
@@ -104,6 +103,34 @@ For information on using Enhanced Skins & Icon Packs, see: xref:enhanced-skins-a
104103

105104
// CCFR here.
106105

106+
=== New `list_max_depth` option to limit list indentation
107+
// #TINY-11937
108+
109+
{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.
110+
111+
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.
112+
113+
Outdent functionality remains unaffected and always available. The state of indent and outdent controls reflects the current indentation capabilities based on this setting.
114+
115+
.Example configuration
116+
117+
The following example shows a basic configuration for the `list_max_depth` option, which limits list indentation to a maximum of 2 levels:
118+
119+
[source,js]
120+
----
121+
tinymce.init({
122+
selector: "textarea",
123+
plugins: [
124+
"advlist", "anchor", "autolink", "charmap", "code", "fullscreen",
125+
"help", "image", "insertdatetime", "link", "lists", "media",
126+
"preview", "searchreplace", "table", "visualblocks",
127+
],
128+
list_max_depth: 2,
129+
toolbar: "undo redo | styles | bold italic underline strikethrough | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
130+
});
131+
----
132+
133+
For more information, see: xref:user-formatting-options.adoc#list_max_depth[User formatting - List max depth].
107134

108135
[[additions]]
109136
== Additions

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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
=== Example
14+
15+
[source,js]
16+
----
17+
tinymce.init({
18+
selector: 'textarea',
19+
plugins: 'lists',
20+
toolbar: 'bullist numlist',
21+
list_max_depth: 2 // limits list nesting to maximum of 2 levels
22+
});
23+
----

0 commit comments

Comments
 (0)