# utils/formathtml

module

<a id="functions">

## Functions

<a id="function-formatHtml">

### `formatHtml( input ) → string`

A simple (and naive) HTML code formatter that returns a formatted HTML markup that can be easily parsed by human eyes. It beautifies the HTML code by adding new lines between elements that behave like block elements (https\://developer.mozilla.org/en-US/docs/Web/HTML/Block-level\_elements and a few more like `tr`, `td`, and similar ones) and inserting indents for nested content.

WARNING: This function works only on a text that does not contain any indentations or new lines. Calling this function on the already formatted text will damage the formatting.

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-utils/src/formathtml.ts#L21)

#### Parameters

* `input: string`

  An HTML string to format.

#### Returns

* `string`

---

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