File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
packages/ckeditor5-editor-multi-root/src Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -644,17 +644,18 @@ export default class MultiRootEditor extends DataApiMixin( Editor ) {
644
644
/**
645
645
* Registers given string as a root attribute key. Registered root attributes are added to
646
646
* {@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() `}.
648
648
*
649
649
* Note: attributes passed in {@link module:core/editor/editorconfig~EditorConfig#rootsAttributes `config.rootsAttributes`} are
650
650
* automatically registered as the editor is initialized. However, registering the same attribute twice does not have any negative
651
651
* impact, so it is recommended to use this method in any feature that uses roots attributes.
652
652
*/
653
653
public registerRootAttribute ( key : string ) : void {
654
- if ( ! this . _registeredRootsAttributesKeys . has ( key ) ) {
655
- this . _registeredRootsAttributesKeys . add ( key ) ;
654
+ if ( this . _registeredRootsAttributesKeys . has ( key ) ) {
655
+ return ;
656
656
}
657
657
658
+ this . _registeredRootsAttributesKeys . add ( key ) ;
658
659
this . editing . model . schema . extend ( '$root' , { allowAttributes : key } ) ;
659
660
}
660
661
You can’t perform that action at this time.
0 commit comments