Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC-3132: Added link_attributes_postprocess option that allows overriding attributes of a link t… #3624

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
}
}
});
----
Loading