浏览代码

Move code comments closer to the code they apply to,

as suggested at https://github.com/ckeditor/ckeditor5/pull/6801#discussion_r425606075

Co-authored-by: Maciej <jodator@jodator.net>

Tomek Wytrębowicz 5 年之前
父节点
当前提交
c5c495762c
共有 1 个文件被更改,包括 5 次插入4 次删除
  1. 5 4
      packages/ckeditor5-table/src/ui/colorinputview.js

+ 5 - 4
packages/ckeditor5-table/src/ui/colorinputview.js

@@ -315,10 +315,11 @@ export default class ColorInputView extends View {
 // @param {String} colorString The value to be normalized.
 // @returns {String}
 function normalizeColor( colorString ) {
-	// Remove any whitespace right after `(` or `,`.
-	// Remove any whitespace at the beginning or right before the end, `)`, `,`, or another whitespace.
-	// Then, replace `,` or whitespace with single space.
-	return colorString.replace( /([(,])\s+/g, '$1' )
+	return colorString
+		// Remove any whitespace right after `(` or `,`.
+		.replace( /([(,])\s+/g, '$1' )
+		// Remove any whitespace at the beginning or right before the end, `)`, `,`, or another whitespace.
 		.replace( /^\s+|\s+(?=[),\s]|$)/g, '' )
+		// Then, replace `,` or whitespace with a single space.
 		.replace( /,|\s/g, ' ' );
 }