浏览代码

Merge branch 'master' into t/1501

Aleksander Nowodzinski 6 年之前
父节点
当前提交
3a34b35458
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      packages/ckeditor5-link/src/utils.js

+ 2 - 4
packages/ckeditor5-link/src/utils.js

@@ -7,8 +7,6 @@
  * @module link/utils
  */
 
-const linkElementSymbol = Symbol( 'linkElement' );
-
 const ATTRIBUTE_WHITESPACES = /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g; // eslint-disable-line no-control-regex
 const SAFE_URL = /^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))/i;
 
@@ -19,7 +17,7 @@ const SAFE_URL = /^(?:(?:https?|ftps?|mailto):|[^a-z]|[a-z+.-]+(?:[^a-z+.:-]|$))
  * @returns {Boolean}
  */
 export function isLinkElement( node ) {
-	return node.is( 'attributeElement' ) && !!node.getCustomProperty( linkElementSymbol );
+	return node.is( 'attributeElement' ) && !!node.getCustomProperty( 'link' );
 }
 
 /**
@@ -31,7 +29,7 @@ export function isLinkElement( node ) {
 export function createLinkElement( href, writer ) {
 	// Priority 5 - https://github.com/ckeditor/ckeditor5-link/issues/121.
 	const linkElement = writer.createAttributeElement( 'a', { href }, { priority: 5 } );
-	writer.setCustomProperty( linkElementSymbol, true, linkElement );
+	writer.setCustomProperty( 'link', true, linkElement );
 
 	return linkElement;
 }