浏览代码

Apply suggestions from code review.

Co-Authored-By: Aleksander Nowodzinski <a.nowodzinski@cksource.com>
Maciej 5 年之前
父节点
当前提交
d0ca3306ee
共有 1 个文件被更改,包括 10 次插入10 次删除
  1. 10 10
      packages/ckeditor5-table/src/commands/mergecellscommand.js

+ 10 - 10
packages/ckeditor5-table/src/commands/mergecellscommand.js

@@ -16,7 +16,7 @@ import { getRowIndexes, getSelectionAffectedTableCells } from '../utils';
 /**
  * The merge cells command.
  *
- * The command is registered by {@link module:table/tableediting~TableEditing} as `'mergeTableCells'` editor command.
+ * The command is registered by the {@link module:table/tableediting~TableEditing} as `'mergeTableCells'` editor command.
  *
  * For example, to merge selected table cells:
  *
@@ -66,7 +66,7 @@ export default class MergeCellsCommand extends Command {
 	}
 }
 
-// Properly removes empty row from a table. Will update `rowspan` attribute of cells that overlaps removed row.
+// Properly removes the empty row from a table. Updates the `rowspan` attribute of cells that overlap the removed row.
 //
 // @param {module:engine/model/element~Element} row
 // @param {module:engine/model/writer~Writer} writer
@@ -89,9 +89,9 @@ function removeRowIfEmpty( row, writer ) {
 	writer.remove( row );
 }
 
-// Merges two table cells - will ensure that after merging cells with empty paragraph the result table cell will only have one paragraph.
-// If one of the merged table cell is empty the merged table cell will have contents of the non-empty table cell.
-// If both are empty the merged table cell will have only one empty paragraph.
+// Merges two table cells - will ensure that after merging cells with empty paragraphs the result table cell will only have one paragraph.
+// If one of the merged table cells is empty, the merged table cell will have contents of the non-empty table cell.
+// If both are empty, the merged table cell will have only one empty paragraph.
 //
 // @param {module:engine/model/element~Element} cellBeingMerged
 // @param {module:engine/model/element~Element} targetCell
@@ -109,7 +109,7 @@ function mergeTableCells( cellBeingMerged, targetCell, writer ) {
 	writer.remove( cellBeingMerged );
 }
 
-// Checks if passed table cell contains empty paragraph.
+// Checks if the passed table cell contains an empty paragraph.
 //
 // @param {module:engine/model/element~Element} tableCell
 // @returns {Boolean}
@@ -117,7 +117,7 @@ function isEmpty( tableCell ) {
 	return tableCell.childCount == 1 && tableCell.getChild( 0 ).is( 'paragraph' ) && tableCell.getChild( 0 ).isEmpty;
 }
 
-// Check if selection contains mergeable cells.
+// Checks if the selection contains mergeable cells.
 //
 // In a table below:
 //
@@ -129,13 +129,13 @@ function isEmpty( tableCell ) {
 //   |       | g | h |
 //   +---+---+---+---+
 //
-// Valid selections are those which creates a solid rectangle (without gaps), such as:
+// Valid selections are these which create a solid rectangle (without gaps), such as:
 //   - a, b (two horizontal cells)
 //   - c, f (two vertical cells)
 //   - a, b, e (cell "e" spans over four cells)
-//   - c, d, f (cell d spans over cell in row below)
+//   - c, d, f (cell d spans over a cell in the row below)
 //
-// While invalid selection would be:
+// While an invalid selection would be:
 //   - a, c (cell "b" not selected creates a gap)
 //   - f, g, h (cell "d" spans over a cell from row of "f" cell - thus creates a gap)
 //