Procházet zdrojové kódy

Remove wrong usage of highest priority from the docs and manual tests.

Maciej Gołaszewski před 6 roky
rodič
revize
abb9acdbd6

+ 2 - 7
packages/ckeditor5-mention/docs/_snippets/features/mention-customization.js

@@ -7,11 +7,6 @@
 
 import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';
 
-import priorities from '@ckeditor/ckeditor5-utils/src/priorities';
-
-// The link plugin using highest priority in conversion pipeline.
-const HIGHER_THEN_HIGHEST = priorities.highest + 50;
-
 ClassicEditor
 	.create( document.querySelector( '#snippet-mention-customization' ), {
 		cloudServices: CS_CONFIG,
@@ -70,7 +65,7 @@ function CustomMention( editor ) {
 				return mentionValue;
 			}
 		},
-		converterPriority: HIGHER_THEN_HIGHEST
+		converterPriority: 'high'
 	} );
 
 	function isFullMention( viewElement ) {
@@ -107,7 +102,7 @@ function CustomMention( editor ) {
 				'href': modelAttributeValue.link
 			} );
 		},
-		converterPriority: HIGHER_THEN_HIGHEST
+		converterPriority: 'high'
 	} );
 }
 

+ 3 - 8
packages/ckeditor5-mention/docs/features/mention.md

@@ -157,14 +157,9 @@ To a link:
 <a class="mention" data-mention="Ted Mosby" data-user-id="5" href="https://www.imdb.com/title/tt0460649/characters/nm1102140">@Ted Mosby</a>
 ```
 
-The below converters must have priority higher then link attribute converter. The mention item in the model must be stored as a plain object with `name` attribute.
+The below converters must have priority 'high' priority as the link attribute converter has 'normal' priority. The mention item in the model must be stored as a plain object with `name` attribute.
 
 ```js
-import priorities from '@ckeditor/ckeditor5-utils/src/priorities';
-
-// The link plugin using highest priority in conversion pipeline.
-const HIGHER_THEN_HIGHEST = priorities.highest + 50;
-
 ClassicEditor
 	.create( document.querySelector( '#editor' ), {
 		plugins: [ Mention, CustomMention, ... ],    // Add custom mention plugin function.
@@ -207,7 +202,7 @@ function CustomMention( editor ) {
 				return mentionValue;
 			}
 		},
-		converterPriority: HIGHER_THEN_HIGHEST
+		converterPriority: 'high'
 	} );
 
 	function isFullMention( viewElement ) {
@@ -244,7 +239,7 @@ function CustomMention( editor ) {
 				'href': modelAttributeValue.link
 			} );
 		},
-		converterPriority: HIGHER_THEN_HIGHEST
+		converterPriority: 'high'
 	} );
 }
 ```

+ 2 - 5
packages/ckeditor5-mention/tests/manual/mention-custom-view.js

@@ -22,13 +22,10 @@ import Link from '@ckeditor/ckeditor5-link/src/link';
 import Italic from '@ckeditor/ckeditor5-basic-styles/src/italic';
 import Underline from '@ckeditor/ckeditor5-basic-styles/src/underline';
 import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
-import priorities from '@ckeditor/ckeditor5-utils/src/priorities';
 
 import MentionUI from '../../src/mentionui';
 import MentionEditing from '../../src/mentionediting';
 
-const HIGHER_THEN_HIGHEST = priorities.highest + 50;
-
 class CustomMentionAttributeView extends Plugin {
 	init() {
 		const editor = this.editor;
@@ -53,7 +50,7 @@ class CustomMentionAttributeView extends Plugin {
 					return mentionValue;
 				}
 			},
-			converterPriority: HIGHER_THEN_HIGHEST
+			converterPriority: 'high'
 		} );
 
 		editor.conversion.for( 'downcast' ).attributeToElement( {
@@ -69,7 +66,7 @@ class CustomMentionAttributeView extends Plugin {
 					'href': modelAttributeValue.link
 				} );
 			},
-			converterPriority: HIGHER_THEN_HIGHEST
+			converterPriority: 'high'
 		} );
 	}
 }