Kaynağa Gözat

Feature: Added the autoformat feature to the article preset.

Piotrek Koszuliński 8 yıl önce
ebeveyn
işleme
3cda4c2b06

+ 8 - 1
packages/ckeditor5-essentials/src/article.js

@@ -11,6 +11,7 @@ import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
 
 import EssentialsPreset from './essentials';
 
+import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat';
 import BlockQuote from '@ckeditor/ckeditor5-block-quote/src/blockquote';
 import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
 import Heading from '@ckeditor/ckeditor5-heading/src/heading';
@@ -26,7 +27,12 @@ import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
 /**
  * Article editor preset. Represents a set of features which enable in the editor
  * all functionalities of a simple article editor.
- * This preset follows [Editor Recommendations](https://github.com/ckeditor/editor-recommendations).
+ *
+ * This preset follows [Editor Recommendations](https://github.com/ckeditor/editor-recommendations) plus
+ * a couple of additions:
+ *
+ * * autoformatting,
+ * * TODO there will be more here soon (upload).
  *
  * @extends module:core/plugin~Plugin
  */
@@ -34,6 +40,7 @@ export default class Article extends Plugin {
 	static get requires() {
 		return [
 			EssentialsPreset,
+			Autoformat,
 			BlockQuote,
 			Bold,
 			Heading,

+ 2 - 0
packages/ckeditor5-essentials/tests/article.js

@@ -10,6 +10,7 @@ import ClassicTestEditor from '@ckeditor/ckeditor5-core/tests/_utils/classictest
 
 import EssentialsPreset from '../src/essentials';
 import Paragraph from '@ckeditor/ckeditor5-paragraph/src/paragraph';
+import Autoformat from '@ckeditor/ckeditor5-autoformat/src/autoformat';
 import Bold from '@ckeditor/ckeditor5-basic-styles/src/bold';
 import Heading from '@ckeditor/ckeditor5-heading/src/heading';
 import Image from '@ckeditor/ckeditor5-image/src/image';
@@ -49,6 +50,7 @@ describe( 'Article preset', () => {
 		expect( editor.plugins.get( EssentialsPreset ) ).to.be.instanceOf( EssentialsPreset );
 
 		expect( editor.plugins.get( Paragraph ) ).to.be.instanceOf( Paragraph );
+		expect( editor.plugins.get( Autoformat ) ).to.be.instanceOf( Autoformat );
 		expect( editor.plugins.get( Bold ) ).to.be.instanceOf( Bold );
 		expect( editor.plugins.get( Heading ) ).to.be.instanceOf( Heading );
 		expect( editor.plugins.get( Image ) ).to.be.instanceOf( Image );