Bladeren bron

Apply suggestions from code review

Co-authored-by: Kuba Niegowski <1232187+niegowski@users.noreply.github.com>
Maciej 5 jaren geleden
bovenliggende
commit
857343be9e
1 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 2 2
      packages/ckeditor5-engine/src/conversion/downcastdispatcher.js

+ 2 - 2
packages/ckeditor5-engine/src/conversion/downcastdispatcher.js

@@ -281,7 +281,7 @@ export default class DowncastDispatcher {
 		const currentView = mapper.toViewElement( element );
 
 		// Remove the old view but do not remove mapper mappings - those will be used to revive existing elements.
-		this.conversionApi.writer.remove( currentView );
+		writer.remove( currentView );
 
 		// Convert the element - without converting children.
 		this._convertInsertWithAttributes( {
@@ -615,7 +615,7 @@ export default class DowncastDispatcher {
 				continue;
 			}
 
-			const element = entry.type === 'attribute' ? getNodeAfterPosition( position, positionParent, textNode ) : positionParent;
+			const element = entry.type === 'attribute' ? getNodeAfterPosition( position, positionParent, null ) : positionParent;
 
 			// Case of text node set directly in root. For now used only in tests but can be possible when enabled in paragraph-like roots.
 			// See: https://github.com/ckeditor/ckeditor5/issues/762.