NB this plugin currently only supports add an id
atrribute. If you'd like to see this expanded to support any attribute please open an issue or create a Pull Request!
<h2 id="i-want-to-scroll-to-this">Example</h2>
To start using the plugin all you need to do is import and register is with CKEDitor, for example:
import ElementAddAttributes from './path/to/plugin';
class ClassicEditor extends ClassicEditorBase {}
ClassicEditor.builtinPlugins = [
// Add core CKEditor plugins etc.
ElementAddAttributes
];
export default ClassicEditor;
By Default the plugin is disabled, to enable the button you'll need to enable it in your configuration. For example:
{
elementAddAttributes: {
enabled: true, // false will disable the button on the UI
},
}
To add the toolbar UI, include it in the configuration. For example:
toolbar: {
items: [
'bold',
'italic',
'|',
'elementAddAttributes',
]
}
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
- Rhys Stubbs - Initial work - GitHub
This project is licensed under the MIT License - see the LICENSE.md file for details
- CKEditor for making me do this ;)