|
@@ -565,16 +565,16 @@ export default class LiveSelection extends Selection {
|
|
|
const range = this.getFirstRange();
|
|
const range = this.getFirstRange();
|
|
|
|
|
|
|
|
// ...look for a first character node in that range and take attributes from it.
|
|
// ...look for a first character node in that range and take attributes from it.
|
|
|
- for ( const item of range ) {
|
|
|
|
|
|
|
+ for ( const value of range ) {
|
|
|
// If the item is an object, we don't want to get attributes from its children.
|
|
// If the item is an object, we don't want to get attributes from its children.
|
|
|
- if ( item.item.is( 'element' ) && schema.objects.has( item.item.name ) ) {
|
|
|
|
|
|
|
+ if ( value.item.is( 'element' ) && schema.objects.has( value.item.name ) ) {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
// This is not an optimal solution because of https://github.com/ckeditor/ckeditor5-engine/issues/454.
|
|
// This is not an optimal solution because of https://github.com/ckeditor/ckeditor5-engine/issues/454.
|
|
|
// It can be done better by using `break;` instead of checking `attrs === null`.
|
|
// It can be done better by using `break;` instead of checking `attrs === null`.
|
|
|
- if ( item.type == 'text' && attrs === null ) {
|
|
|
|
|
- attrs = item.item.getAttributes();
|
|
|
|
|
|
|
+ if ( value.type == 'text' && attrs === null ) {
|
|
|
|
|
+ attrs = value.item.getAttributes();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|