From 8bae5c1bf6a0acdad8e6be038aff15647381c714 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 27 Aug 2025 12:59:39 +1000 Subject: [PATCH 1/3] DOC-3209: editor.getContent() now includes indent and entity_encoding properties to control HTML formatting. --- modules/ROOT/pages/8.1.0-release-notes.adoc | 41 +++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/modules/ROOT/pages/8.1.0-release-notes.adoc b/modules/ROOT/pages/8.1.0-release-notes.adoc index 3e7a6181b4..86645a22c5 100644 --- a/modules/ROOT/pages/8.1.0-release-notes.adoc +++ b/modules/ROOT/pages/8.1.0-release-notes.adoc @@ -65,6 +65,47 @@ The following premium plugin updates were released alongside {productname} {rele // CCFR here. +=== `editor.getContent()` now includes `indent` and `entity_encoding` properties to control HTML formatting +// #TINY-12786 + +Previously, when using the {productname} `+getContent+` API, options such as `+indent+` and `+entity_encoding+` could not be overridden during the call. The editor always applied its initial configuration, which limited flexibility when retrieving content. This meant integrators were restricted to the defaults set at initialization, with no way to adjust formatting behavior per call. + +In {release-version}, the `+getContent+` API has been enhanced to support per-call overrides for `+indent+` and `+entity_encoding+`. These options can now be specified directly when invoking `+getContent+`, regardless of the editor’s default configuration. This improvement gives developers greater control over output formatting, allowing tailored content retrieval for different use cases. + +.Example: how to use the `+getContent+` API to retrieve content with different formatting options. +[source,js] +---- +// Disable indentation +tinymce.get(0).getContent({ indent: false }); + +// Serialize using named entities +tinymce.get(0).getContent({ indent: false, entity_encoding: 'named' }); + +// Serialize using numeric entities +tinymce.get(0).getContent({ indent: false, entity_encoding: 'numeric' }); + +// Serialize core entities as named, others as numeric +tinymce.get(0).getContent({ indent: false, entity_encoding: 'named+numeric' }); + +// Output raw characters +tinymce.get(0).getContent({ indent: false, entity_encoding: 'raw' }); +---- + +or + +.Example of configuring the editor to use named entities and disable indentation. +[source,js] +---- +tinymce.init({ + selector: "textarea", + entity_encoding: 'named', // or 'numeric' or 'raw' + indent: false, // or true +}); +---- + +For more information on the `+getContent+` API, see `xref:apis/tinymce.editor.adoc#getContent[getContent()]`. + + [[additions]] == Additions From 7a125ff2e338e19d68972e16cb5fe413e27f3142 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Wed, 27 Aug 2025 13:03:07 +1000 Subject: [PATCH 2/3] Update modules/ROOT/pages/8.1.0-release-notes.adoc --- modules/ROOT/pages/8.1.0-release-notes.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/8.1.0-release-notes.adoc b/modules/ROOT/pages/8.1.0-release-notes.adoc index 86645a22c5..07c92bf084 100644 --- a/modules/ROOT/pages/8.1.0-release-notes.adoc +++ b/modules/ROOT/pages/8.1.0-release-notes.adoc @@ -70,7 +70,7 @@ The following premium plugin updates were released alongside {productname} {rele Previously, when using the {productname} `+getContent+` API, options such as `+indent+` and `+entity_encoding+` could not be overridden during the call. The editor always applied its initial configuration, which limited flexibility when retrieving content. This meant integrators were restricted to the defaults set at initialization, with no way to adjust formatting behavior per call. -In {release-version}, the `+getContent+` API has been enhanced to support per-call overrides for `+indent+` and `+entity_encoding+`. These options can now be specified directly when invoking `+getContent+`, regardless of the editor’s default configuration. This improvement gives developers greater control over output formatting, allowing tailored content retrieval for different use cases. +In {productname} {release-version}, the `+getContent+` API has been enhanced to support per-call overrides for `+indent+` and `+entity_encoding+`. These options can now be specified directly when invoking `+getContent+`, regardless of the editor’s default configuration. This improvement gives developers greater control over output formatting, allowing tailored content retrieval for different use cases. .Example: how to use the `+getContent+` API to retrieve content with different formatting options. [source,js] From 116fa58c6b47487c4f799d5c958bc57d765aa050 Mon Sep 17 00:00:00 2001 From: Karl Kemister-Sheppard Date: Fri, 29 Aug 2025 09:20:12 +1000 Subject: [PATCH 3/3] Update modules/ROOT/pages/8.1.0-release-notes.adoc Co-authored-by: Shan --- modules/ROOT/pages/8.1.0-release-notes.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/8.1.0-release-notes.adoc b/modules/ROOT/pages/8.1.0-release-notes.adoc index 07c92bf084..3d27f7b27c 100644 --- a/modules/ROOT/pages/8.1.0-release-notes.adoc +++ b/modules/ROOT/pages/8.1.0-release-notes.adoc @@ -93,7 +93,7 @@ tinymce.get(0).getContent({ indent: false, entity_encoding: 'raw' }); or -.Example of configuring the editor to use named entities and disable indentation. +.Example of configuring the editor to use named entity encoding and disable indentation. [source,js] ---- tinymce.init({