Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Other: Add pluginName property to editing plugins.
Browse files Browse the repository at this point in the history
  • Loading branch information
scofalik committed Oct 10, 2019
1 parent 133c647 commit 44fcbc7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/blockautoformatediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ import LiveRange from '@ckeditor/ckeditor5-engine/src/model/liverange';
* (lists, headings, bold and italic).
*/
export default class BlockAutoformatEditing {
/**
* @inheritDoc
*/
static get pluginName() {
return 'BlockAutoformatEditing';
}

/**
* Creates a listener triggered on `change` event in the document.
* Calls the callback when inserted text matches the regular expression or the command name
Expand Down
7 changes: 7 additions & 0 deletions src/inlineautoformatediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ import getLastTextLine from '@ckeditor/ckeditor5-typing/src/utils/getlasttextlin
* (lists, headings, bold and italic).
*/
export default class InlineAutoformatEditing {
/**
* @inheritDoc
*/
static get pluginName() {
return 'InlineAutoformatEditing';
}

/**
* Enables autoformatting mechanism for a given {@link module:core/editor/editor~Editor}.
*
Expand Down
4 changes: 4 additions & 0 deletions tests/blockautoformatediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ describe( 'BlockAutoformatEditing', () => {
} );
} );

it( 'should have pluginName', () => {
expect( BlockAutoformatEditing.pluginName ).to.equal( 'BlockAutoformatEditing' );
} );

describe( 'command name', () => {
it( 'should run a command when the pattern is matched', () => {
const spy = testUtils.sinon.spy();
Expand Down
4 changes: 4 additions & 0 deletions tests/inlineautoformatediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ describe( 'InlineAutoformatEditing', () => {
} );
} );

it( 'should have pluginName', () => {
expect( InlineAutoformatEditing.pluginName ).to.equal( 'InlineAutoformatEditing' );
} );

describe( 'attribute', () => {
it( 'should stop early if there are less than 3 capture groups', () => {
new InlineAutoformatEditing( editor, /(\*)(.+?)\*/g, 'testAttribute' ); // eslint-disable-line no-new
Expand Down

0 comments on commit 44fcbc7

Please sign in to comment.