Post Reads 1 read

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

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’.

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top
%d bloggers like this: