From f6abd7e73c2cf4746c8d2c9126ccfa625ca7bec8 Mon Sep 17 00:00:00 2001 From: abhinavgandham Date: Tue, 18 Feb 2025 15:29:01 +1000 Subject: [PATCH 1/5] DOC-3132: Added option that allows overriding attributes of a link that would be inserted through the link dialog. --- modules/ROOT/pages/7.7.0-release-notes.adoc | 7 +++-- modules/ROOT/pages/link.adoc | 2 ++ .../link_attributes_postprocess.adoc | 26 +++++++++++++++++++ 3 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 modules/ROOT/partials/configuration/link_attributes_postprocess.adoc diff --git a/modules/ROOT/pages/7.7.0-release-notes.adoc b/modules/ROOT/pages/7.7.0-release-notes.adoc index 7494a3a346..c22f0627b3 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 that would be 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 called `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..a71434f63a --- /dev/null +++ b/modules/ROOT/partials/configuration/link_attributes_postprocess.adoc @@ -0,0 +1,26 @@ +[[link_attributes_postprocess]] +== `+link_attributes_postprocess+` + +This option allows you to override attriutes of the 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'; + } + } +}); + +---- From 54f8d865b5eac93fc1c03fa182d2225d6edf32b6 Mon Sep 17 00:00:00 2001 From: "CODE:AG" <57781325+abhinavgandham@users.noreply.github.com> Date: Tue, 18 Feb 2025 17:24:51 +1000 Subject: [PATCH 2/5] Update modules/ROOT/pages/7.7.0-release-notes.adoc Co-authored-by: Sorita Heng <69398037+soritaheng@users.noreply.github.com> --- modules/ROOT/pages/7.7.0-release-notes.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/7.7.0-release-notes.adoc b/modules/ROOT/pages/7.7.0-release-notes.adoc index c22f0627b3..c5d5a627d3 100644 --- a/modules/ROOT/pages/7.7.0-release-notes.adoc +++ b/modules/ROOT/pages/7.7.0-release-notes.adoc @@ -168,7 +168,7 @@ For information on the **Image Optimizer** plugin, see: xref:uploadcare.adoc[Ima {productname} {release-version} also includes the following improvement: -=== Added `link_attributes_postprocess` option that allows overriding attributes of a link that would be inserted through the link dialog.' +=== 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 called `link_attributes_postprocess` has been added that allows this functionality. From ada2eb67ab25e16504ae1eff60768f6011781d4c Mon Sep 17 00:00:00 2001 From: "CODE:AG" <57781325+abhinavgandham@users.noreply.github.com> Date: Wed, 19 Feb 2025 09:03:25 +1000 Subject: [PATCH 3/5] Update modules/ROOT/pages/7.7.0-release-notes.adoc Co-authored-by: Karl Kemister-Sheppard --- modules/ROOT/pages/7.7.0-release-notes.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/7.7.0-release-notes.adoc b/modules/ROOT/pages/7.7.0-release-notes.adoc index c5d5a627d3..b698ebe945 100644 --- a/modules/ROOT/pages/7.7.0-release-notes.adoc +++ b/modules/ROOT/pages/7.7.0-release-notes.adoc @@ -168,7 +168,7 @@ For information on the **Image Optimizer** plugin, see: xref:uploadcare.adoc[Ima {productname} {release-version} also includes the following improvement: -=== Added `link_attributes_postprocess` option that allows overriding attributes of a link inserted through the link dialog.' +=== 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 called `link_attributes_postprocess` has been added that allows this functionality. From b52db4136546fac2da6c5d9a673974a396415878 Mon Sep 17 00:00:00 2001 From: "CODE:AG" <57781325+abhinavgandham@users.noreply.github.com> Date: Wed, 19 Feb 2025 09:03:40 +1000 Subject: [PATCH 4/5] Update modules/ROOT/partials/configuration/link_attributes_postprocess.adoc Co-authored-by: Karl Kemister-Sheppard --- .../partials/configuration/link_attributes_postprocess.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/partials/configuration/link_attributes_postprocess.adoc b/modules/ROOT/partials/configuration/link_attributes_postprocess.adoc index a71434f63a..1ae88d09c7 100644 --- a/modules/ROOT/partials/configuration/link_attributes_postprocess.adoc +++ b/modules/ROOT/partials/configuration/link_attributes_postprocess.adoc @@ -1,7 +1,7 @@ [[link_attributes_postprocess]] == `+link_attributes_postprocess+` -This option allows you to override attriutes of the inserted link. +This option allows overriding attributes of an inserted link. *Type:* `+Function+` From 4a6935f23b467606fe75875e4866cfdc643f1562 Mon Sep 17 00:00:00 2001 From: "CODE:AG" <57781325+abhinavgandham@users.noreply.github.com> Date: Wed, 19 Feb 2025 09:04:10 +1000 Subject: [PATCH 5/5] Update modules/ROOT/pages/7.7.0-release-notes.adoc Co-authored-by: Karl Kemister-Sheppard --- modules/ROOT/pages/7.7.0-release-notes.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ROOT/pages/7.7.0-release-notes.adoc b/modules/ROOT/pages/7.7.0-release-notes.adoc index b698ebe945..28b61d42e7 100644 --- a/modules/ROOT/pages/7.7.0-release-notes.adoc +++ b/modules/ROOT/pages/7.7.0-release-notes.adoc @@ -171,7 +171,7 @@ For information on the **Image Optimizer** plugin, see: xref:uploadcare.adoc[Ima === 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 called `link_attributes_postprocess` has been added that allows this functionality. +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