https://github.com/nodejh/tinymce-plugin-formatlink
add attribute to anchor tag
https://github.com/nodejh/tinymce-plugin-formatlink
Last synced: about 1 year ago
JSON representation
add attribute to anchor tag
- Host: GitHub
- URL: https://github.com/nodejh/tinymce-plugin-formatlink
- Owner: nodejh
- Created: 2019-06-17T11:21:57.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-06-17T11:54:18.000Z (over 6 years ago)
- Last Synced: 2025-01-16T12:52:31.187Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 1.75 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tinymce Plugin Formatlink
- add attributes to `a` tag
The plugin auto add `target="_blank"` and `rel="noopener noreferrer"` to `a` tag when press `enter` `space` or `Arrow Right`.
## Config
```js
tinymce.init({
// ...
plugins: 'formatlink',
formatlink_attr_target: '_blank', // option, default: '_blank'
formatlink_attr_rel: 'noopener noreferrer', // option, default: noopener noreferrer
});
```
## usage
Clone the project, and copy `formatlink` to tinymce plugins source code. Add `formatlink` to `Gruntfile.js`, build tinymce project.
### Clone prjects
```sh
$ git clone https://github.com/tinymce/tinymce.git
$ git clone https://github.com/nodejh/tinymce-plugin-formatlink.git
$ cp -r tinymce-plugin-formatlink/formatlink tinymce/modules/tinymce/src/plugins
```
### Change Grunt Config
Edit `tinymce/modules/tinymce/Gruntfile.js`:
```js
// ...
let plugins = [
// ...
'formatlink',
];
```
### Dev
```sh
$ yarn
$ yarn start
```
Then open browser and go to `http://localhost:3000/src/plugins/formatlink/demo/html/demo.html`.
## Demo
