diff --git a/modules/ROOT/pages/8.1.0-release-notes.adoc b/modules/ROOT/pages/8.1.0-release-notes.adoc index 09c031cce5..886c1d98a4 100644 --- a/modules/ROOT/pages/8.1.0-release-notes.adoc +++ b/modules/ROOT/pages/8.1.0-release-notes.adoc @@ -204,6 +204,46 @@ For information on the **Suggested Edits** plugin, see: xref:suggestededits.adoc // 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 {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] +---- +// 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 entity encoding 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()]`. + === Clicking on a non selectable element when the selection is off screen no longer scrolls to the selection // #TINY-12245 @@ -212,7 +252,6 @@ Previously, and issue was identified where clicking the editor's horizontal scro {productname} {release-version} addresses this issue. Now, the editor avoids taking focus when users click elements that are not selectable (such as scrollbars), preventing unintended vertical scrolling. - [[additions]] == Additions