diff --git a/modules/ROOT/pages/7.7.0-release-notes.adoc b/modules/ROOT/pages/7.7.0-release-notes.adoc index 41624e1205..67dba91212 100644 --- a/modules/ROOT/pages/7.7.0-release-notes.adoc +++ b/modules/ROOT/pages/7.7.0-release-notes.adoc @@ -168,11 +168,10 @@ For information on the **Image Optimizer** plugin, see: xref:uploadcare.adoc[Ima {productname} {release-version} also includes the following improvement: -=== -// #TINY-vwxyz1 - -// CCFR here. +=== Added `link_attributes_postprocess` option that allows overriding attributes of a link inserted through the link dialog. +// #TINY-11707 +Previously in the xref:link.adoc[Link] plugin, there was no ability to override attributes of a link. With the release of {productname} {release-version}, a new option xref:link.adoc#link_attributes_postprocess[link_attributes_postprocess] has been added that allows this functionality. [[additions]] == Additions diff --git a/modules/ROOT/pages/link.adoc b/modules/ROOT/pages/link.adoc index 24137ba934..22a08f1458 100644 --- a/modules/ROOT/pages/link.adoc +++ b/modules/ROOT/pages/link.adoc @@ -46,6 +46,8 @@ include::partial$configuration/link_rel_list.adoc[leveloffset=+1] include::partial$configuration/link_target_list.adoc[leveloffset=+1] +include::partial$configuration/link_attributes_postprocess.adoc[leveloffset=+1] + include::partial$misc/plugin-toolbar-button-id-boilerplate.adoc[] include::partial$misc/plugin-menu-item-id-boilerplate.adoc[] diff --git a/modules/ROOT/partials/configuration/link_attributes_postprocess.adoc b/modules/ROOT/partials/configuration/link_attributes_postprocess.adoc new file mode 100644 index 0000000000..1ae88d09c7 --- /dev/null +++ b/modules/ROOT/partials/configuration/link_attributes_postprocess.adoc @@ -0,0 +1,26 @@ +[[link_attributes_postprocess]] +== `+link_attributes_postprocess+` + +This option allows overriding attributes of an inserted link. + +*Type:* `+Function+` + +*Default value:* `+undefined+` + +=== Example: using `+link_attributes_postprocess+` + +[source,js] +---- +tinymce.init({ + selector: 'textarea', // change this value according to your HTML + plugins: 'link', + toolbar: 'link', + link_attributes_postprocess: (attrs) => { + console.log(attrs); + if (attrs.rel) { + attrs.rel += 'noreferrer'; + } + } +}); + +----