8
0
Pārlūkot izejas kodu

Docs: Improved the decorators section of the link guide. Minor improvements to other link docs.

Aleksander Nowodzinski 6 gadi atpakaļ
vecāks
revīzija
bb971a81bc

+ 5 - 9
packages/ckeditor5-link/docs/_snippets/features/linkdecorators.html

@@ -1,14 +1,10 @@
 <div id="snippet-link-decorators">
-	<h2>Links list</h2>
-	<ol>
-		<li>
-			<a href="https://ckeditor.com">Link to external page</a>
-		</li>
-		<li>
-			<a href="/">Link to internal page</a>
-		</li>
-	</ol>
+	<p>
+		An <a href="https://ckeditor.com">external page</a> and a
+		<a download="download" href="/">downloadable resource</a>.
+	</p>
 </div>
+
 <pre class="highlight">
 	<code class="html hljs" id="output-link-decorators"></code>
 </pre>

+ 1 - 1
packages/ckeditor5-link/docs/_snippets/features/linkdecorators.js

@@ -24,7 +24,7 @@ ClassicEditor
 			viewportTopOffset: window.getViewportTopOffsetConfig()
 		},
 		link: {
-			targetDecorator: true,
+			addTargetToExternalLinks: true,
 			decorators: [
 				{
 					mode: 'manual',

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 56 - 33
packages/ckeditor5-link/docs/features/link.md


+ 12 - 6
packages/ckeditor5-link/src/link.js

@@ -61,6 +61,12 @@ export default class Link extends Plugin {
  * When set `true`, the `target="blank"` and `rel="noopener noreferrer"` attributes are automatically added to all external links
  * in the editor. By external are meant all links in the editor content starting with `http`, `https`, or `//`.
  *
+ *		const config = {
+ *			link: {
+ *				addTargetToExternalLinks: true
+ *			}
+ *		};
+ *
  * Internally, this option activates a predefined {@link module:link/link~LinkConfig#decorators automatic link decorator},
  * which extends all external links with the `target` and `rel` attributes without additional configuration.
  *
@@ -119,7 +125,7 @@ export default class Link extends Plugin {
  * and {@link module:link/link~LinkDecoratorManualDefinition manual} decorator option reference.
  *
  * **Warning:** Currently, link decorators work independently and no conflict resolution mechanism exists.
- * For example, configuring the `target` attribute using both an automatic and a manual decorator at a time could end up with a
+ * For example, configuring the `target` attribute using both an automatic and a manual decorator at a time could end up with
  * quirky results. The same applies if multiple manual or automatic decorators were defined for the same attribute.
  *
  * **Note**: Since the `target` attribute management for external links is a common use case, there is a predefined automatic decorator
@@ -127,22 +133,22 @@ export default class Link extends Plugin {
  * {@link module:link/link~LinkConfig#addTargetToExternalLinks `config.link.addTargetToExternalLinks`}
  * configuration description to learn more.
  *
- * See also {@glink features/link#decorators link's feature} guide for more information.
+ * See also {@glink features/link#custom-link-attributes-decorators link's feature} guide for more information.
  *
  * @member {Object.<String, module:link/link~LinkDecoratorDefinition>} module:link/link~LinkConfig#decorators
  */
 
 /**
- * Represents a link decorator definition {@link module:link/link~LinkDecoratorManualDefinition `'manual'`} or
- * {@link module:link/link~LinkDecoratorAutomaticDefinition `'automatic'`}.
+ * Represents a link decorator definition ({@link module:link/link~LinkDecoratorManualDefinition `'manual'`}
+ * or {@link module:link/link~LinkDecoratorAutomaticDefinition `'automatic'`}).
  *
  * @interface LinkDecoratorDefinition
  */
 
 /**
- * The kind of the decorator. `'manual'` for all manual decorators and `'automatic'` for all automatic decorators.
+ * The kind of the decorator.
  *
- * See also {@glink features/link#decorators link's feature} guide for more information.
+ * Check out the {@glink features/link#custom-link-attributes-decorators link feature} guide for more information.
  *
  * @member {'manual'|'automatic'} module:link/link~LinkDecoratorDefinition#mode
  */