Procházet zdrojové kódy

Limit autoformat to paragraphs.

Maksymilian Barnaś před 9 roky
rodič
revize
698cb1b39e

+ 2 - 2
packages/ckeditor5-autoformat/src/autoformatengine.js

@@ -41,7 +41,7 @@ export default class AutoformatEngine {
 				return;
 			}
 
-			for ( let value of changes.range.getItems( { singleCharacters: true } ) ) {
+			for ( let value of changes.range.getItems() ) {
 				const walker = new TreeWalker( {
 					direction: 'backward',
 					startPosition: Position.createAfter( value )
@@ -49,7 +49,7 @@ export default class AutoformatEngine {
 				const currentValue = walker.next().value;
 				const text = currentValue.item.data;
 
-				if ( !text ) {
+				if ( currentValue.item.parent.name !== 'paragraph' || !text ) {
 					return;
 				}