Skip to content

Commit 85a2c2d

Browse files
abhinavgandhamsoritahengkemister85
authored
DOC-3132: Added link_attributes_postprocess option that allows overriding 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]>
1 parent 60a83ad commit 85a2c2d

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,10 @@ For information on the **Image Optimizer** plugin, see: xref:uploadcare.adoc[Ima
168168

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

171-
=== <TINY-vwxyz 1 changelog entry>
172-
// #TINY-vwxyz1
173-
174-
// CCFR here.
171+
=== Added `link_attributes_postprocess` option that allows overriding attributes of a link inserted through the link dialog.
172+
// #TINY-11707
175173

174+
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.
176175

177176
[[additions]]
178177
== Additions

modules/ROOT/pages/link.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ include::partial$configuration/link_rel_list.adoc[leveloffset=+1]
4646

4747
include::partial$configuration/link_target_list.adoc[leveloffset=+1]
4848

49+
include::partial$configuration/link_attributes_postprocess.adoc[leveloffset=+1]
50+
4951
include::partial$misc/plugin-toolbar-button-id-boilerplate.adoc[]
5052

5153
include::partial$misc/plugin-menu-item-id-boilerplate.adoc[]
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
[[link_attributes_postprocess]]
2+
== `+link_attributes_postprocess+`
3+
4+
This option allows overriding attributes of an inserted link.
5+
6+
*Type:* `+Function+`
7+
8+
*Default value:* `+undefined+`
9+
10+
=== Example: using `+link_attributes_postprocess+`
11+
12+
[source,js]
13+
----
14+
tinymce.init({
15+
selector: 'textarea', // change this value according to your HTML
16+
plugins: 'link',
17+
toolbar: 'link',
18+
link_attributes_postprocess: (attrs) => {
19+
console.log(attrs);
20+
if (attrs.rel) {
21+
attrs.rel += 'noreferrer';
22+
}
23+
}
24+
});
25+
26+
----

0 commit comments

Comments
 (0)