mentionediting.js 641 B

12345678910111213141516171819202122232425262728293031323334
  1. /**
  2. * @license Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  4. */
  5. /**
  6. * @module mention/mentionediting
  7. */
  8. import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
  9. /**
  10. * The mention editing feature.
  11. *
  12. * @extends module:core/plugin~Plugin
  13. */
  14. export default class MentionEditing extends Plugin {
  15. /**
  16. * @inheritDoc
  17. */
  18. static get pluginName() {
  19. return 'MentionEditing';
  20. }
  21. /**
  22. * @inheritDoc
  23. */
  24. init() {
  25. const editor = this.editor;
  26. // Allow fontSize attribute on text nodes.
  27. editor.model.schema.extend( '$text', { allowAttributes: 'mention' } );
  28. }
  29. }