소스 검색

Fix dev comment.

panr 5 년 전
부모
커밋
1c60eae3fd
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      packages/ckeditor5-link/src/linkui.js

+ 2 - 2
packages/ckeditor5-link/src/linkui.js

@@ -157,13 +157,13 @@ export default class LinkUI extends Plugin {
 		this.listenTo( formView, 'submit', () => {
 			const { value } = formView.urlInputView.fieldView.element;
 
+			// It's good to check the config for the second time on submit.
+			// This will cover more dynamic cases, when protocol might change after the element has been rendered.
 			const defaultProtocol = editor.config.get( 'link.defaultProtocol' );
 
 			const isProtocolNeeded = !!defaultProtocol && !( /^((\w+:(\/{2,})?)|(\W))/gmi ).test( value );
 			const isEmail = ( /[\w-]+@[\w-]+\.+[\w-]+/gmi ).test( value );
 
-			// It's good to check config second time on submit for more dynamic cases
-			// when protocol might change after the element rendered.
 			const protocol = isEmail && 'mailto:' || defaultProtocol;
 			const parsedValue = value && isProtocolNeeded ? protocol + value : value;