| 741 | | var newBlock = getElement( this, doc ); |
| 742 | | replaceBlock( block, newBlock ); |
| | 741 | var newBlock = getElement( this, doc ), |
| | 742 | def = this._.definition, |
| | 743 | attributes = def.attributes, |
| | 744 | styles = def.styles; |
| | 745 | |
| | 746 | if ( block.getName() == def.element ) |
| | 747 | { |
| | 748 | for ( var attName in attributes ) |
| | 749 | { |
| | 750 | if ( newBlock.getAttribute( attName ) == block.getAttribute( attName ) ) |
| | 751 | newBlock.removeAttribute( attName ); |
| | 752 | } |
| | 753 | |
| | 754 | for ( var styleName in styles ) |
| | 755 | { |
| | 756 | if ( newBlock.getStyle( styleName ) == block.getStyle( styleName ) ) |
| | 757 | newBlock.removeStyle( styleName ); |
| | 758 | } |
| | 759 | |
| | 760 | if ( newBlock.hasAttributes() ) |
| | 761 | replaceBlock( block, newBlock ) |
| | 762 | else |
| | 763 | removeBlockStyle( block, this._.enterMode ); |
| | 764 | } |
| | 765 | else |
| | 766 | replaceBlock( block, newBlock ) |
| | 767 | |