Skip to content

Commit

Permalink
DOC-3132: Added link_attributes_postprocess option that allows over…
Browse files Browse the repository at this point in the history
…riding attributes of a link t… (#3624)

* DOC-3132: Added  option that allows overriding attributes of a link that would be inserted through the link dialog.

* Update modules/ROOT/pages/7.7.0-release-notes.adoc

Co-authored-by: Sorita Heng <[email protected]>

* Update modules/ROOT/pages/7.7.0-release-notes.adoc

Co-authored-by: Karl Kemister-Sheppard <[email protected]>

* Update modules/ROOT/partials/configuration/link_attributes_postprocess.adoc

Co-authored-by: Karl Kemister-Sheppard <[email protected]>

* Update modules/ROOT/pages/7.7.0-release-notes.adoc

Co-authored-by: Karl Kemister-Sheppard <[email protected]>

---------

Co-authored-by: Sorita Heng <[email protected]>
Co-authored-by: Karl Kemister-Sheppard <[email protected]>
  • Loading branch information
3 people authored Feb 18, 2025
1 parent 60a83ad commit 85a2c2d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 4 deletions.
7 changes: 3 additions & 4 deletions modules/ROOT/pages/7.7.0-release-notes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,10 @@ For information on the **Image Optimizer** plugin, see: xref:uploadcare.adoc[Ima

{productname} {release-version} also includes the following improvement<s>:

=== <TINY-vwxyz 1 changelog entry>
// #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
Expand Down
2 changes: 2 additions & 0 deletions modules/ROOT/pages/link.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
}
}
});
----

0 comments on commit 85a2c2d

Please sign in to comment.