-
Notifications
You must be signed in to change notification settings - Fork 220
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOC-3132: Added
link_attributes_postprocess
option that allows over…
…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
1 parent
60a83ad
commit 85a2c2d
Showing
3 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
modules/ROOT/partials/configuration/link_attributes_postprocess.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
} | ||
} | ||
}); | ||
---- |