8
0
Просмотр исходного кода

Fix table cell paragraph post-fixer.

Maciej Gołaszewski 6 лет назад
Родитель
Сommit
d94b794327

+ 6 - 0
packages/ckeditor5-table/src/converters/table-cell-paragraph-post-fixer.js

@@ -55,6 +55,12 @@ function tableCellContentsPostFixer( writer, model ) {
 			if ( entry.name == 'tableCell' ) {
 			if ( entry.name == 'tableCell' ) {
 				wasFixed = fixTableCellContent( entry.position.nodeAfter, writer ) || wasFixed;
 				wasFixed = fixTableCellContent( entry.position.nodeAfter, writer ) || wasFixed;
 			}
 			}
+
+			// Check table cell children for directly placed text nodes.
+			// Temporary check. See https://github.com/ckeditor/ckeditor5/issues/1464.
+			if ( entry.name == '$text' && entry.position.parent.is( 'tableCell' ) ) {
+				wasFixed = fixTableCellContent( entry.position.parent, writer ) || wasFixed;
+			}
 		}
 		}
 	}
 	}
 
 

+ 0 - 6
packages/ckeditor5-table/src/converters/table-cell-refresh-post-fixer.js

@@ -67,12 +67,6 @@ function checkRefresh( tableCell, type ) {
 	}
 	}
 
 
 	const children = Array.from( tableCell.getChildren() );
 	const children = Array.from( tableCell.getChildren() );
-	const hasInnerText = children.some( child => child.is( 'text' ) );
-
-	// If a bare text node (not wrapped in a paragraph) was added - refresh it.
-	if ( hasInnerText ) {
-		return true;
-	}
 
 
 	const hasInnerParagraph = children.some( child => child.is( 'paragraph' ) );
 	const hasInnerParagraph = children.some( child => child.is( 'paragraph' ) );