@wordpress/autop

Advertisement

The Autop is a simple Gutenberg module which add or remove the <p> tags from the provided content.

Installation Installation

npm install @wordpress/autop --save

Top ↑

Usage Usage

Using the autop function Using the autop function

import { autop } from '@wordpress/autop';
autop( 'Hello World' );

The above code convert the string ‘

Hello World’.

Top ↑

Using the removep function Using the removep function

import { removep } from '@wordpress/autop';
removep( '<p>Hello World</p>' );

The above code convert the string ‘Hello World’.

Leave a Reply