wordpress-autop

Changes double line-breaks in WordPress posts into HTML paragraphs (<p>...</p>).

Usage no npm install needed!

<script type="module">
  import wordpressAutop from 'https://cdn.skypack.dev/wordpress-autop';
</script>

README

wordpress-autop

Sometimes you need the wpautop function from WordPress because you’re working with WXR files in javascript.

Lifted shamelessly from WordPress core.

Bugs

I don’t support this code. If there are bugs then open an issue with WordPress core; if this code is out of date then make a PR and I’ll be happy to update this package.