# engine/model/utils/autoparagraphing

module

<a id="functions">

## Functions

<a id="function-autoParagraphEmptyRoots">

### `autoParagraphEmptyRoots( writer ) → boolean` _(internal)_

Fixes all empty roots.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/model/utils/autoparagraphing.ts#L22)

#### Parameters

* `writer: ModelWriter`

  The model writer.

#### Returns

* `boolean`

  `true` if any change has been applied, `false` otherwise.

<a id="function-isParagraphable">

### `isParagraphable( position, nodeOrType, schema ) → boolean` _(internal)_

Checks if the given node wrapped with a paragraph would be accepted by the schema in the given position.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/model/utils/autoparagraphing.ts#L50)

#### Parameters

* `position: ModelPosition`

  The position at which to check.

* `nodeOrType: string | ModelNode`

  The child node or child type to check.

* `schema: ModelSchema`

  A schema instance used for element validation.

#### Returns

* `boolean`

<a id="function-wrapInParagraph">

### `wrapInParagraph( position, writer ) → ModelPosition` _(internal)_

Inserts a new paragraph at the given position and returns a position inside that paragraph.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/model/utils/autoparagraphing.ts#L78)

#### Parameters

* `position: ModelPosition`

  The position where a paragraph should be inserted.

* `writer: ModelWriter`

  The model writer.

#### Returns

* `ModelPosition`

  Position inside the created paragraph.

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
