Skip to content

Commit e385d23

Browse files
authored
Some fixes after review.
1 parent 287fabd commit e385d23

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/ckeditor5-editor-multi-root/src/multirooteditor.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -644,17 +644,18 @@ export default class MultiRootEditor extends DataApiMixin( Editor ) {
644644
/**
645645
* Registers given string as a root attribute key. Registered root attributes are added to
646646
* {@link module:engine/model/schema~Schema schema}, and also returned by
647-
* {@link ~#getRootAttributes `getRootAttributes`} and {@link ~#getRootsAttributes `getRootsAttributes`}.
647+
* {@link ~#getRootAttributes `getRootAttributes()`} and {@link ~#getRootsAttributes `getRootsAttributes()`}.
648648
*
649649
* Note: attributes passed in {@link module:core/editor/editorconfig~EditorConfig#rootsAttributes `config.rootsAttributes`} are
650650
* automatically registered as the editor is initialized. However, registering the same attribute twice does not have any negative
651651
* impact, so it is recommended to use this method in any feature that uses roots attributes.
652652
*/
653653
public registerRootAttribute( key: string ): void {
654-
if ( !this._registeredRootsAttributesKeys.has( key ) ) {
655-
this._registeredRootsAttributesKeys.add( key );
654+
if ( this._registeredRootsAttributesKeys.has( key ) ) {
655+
return;
656656
}
657657

658+
this._registeredRootsAttributesKeys.add( key );
658659
this.editing.model.schema.extend( '$root', { allowAttributes: key } );
659660
}
660661

0 commit comments

Comments
 (0)