Skip to content

Commit

Permalink
Merge pull request #53 from WordPress/add/wpautop
Browse files Browse the repository at this point in the history
Add package: autop
  • Loading branch information
aduth authored Jan 4, 2018
2 parents 6cbae56 + a0aa145 commit 724b7c4
Show file tree
Hide file tree
Showing 5 changed files with 962 additions and 0 deletions.
30 changes: 30 additions & 0 deletions packages/autop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# @wordpress/autop

JavaScript port of WordPress's automatic paragraph function `autop` and the `removep` reverse behavior.

## Installation

Install the module

```bash
npm install @wordpress/autop --save
```

### Usage

Import the desired function(s) from `@wordpress/autop`:

```js
import { autop, removep } from '@wordpress/autop';

autop( 'my text' );
// "<p>my text</p>"

removep( '<p>my text</p>' );
// "my text"
```

### API Usage

* `autop( text: string ): string`
* `remove( text: string ): string`
5 changes: 5 additions & 0 deletions packages/autop/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions packages/autop/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "@wordpress/autop",
"version": "1.0.0",
"repository": {
"type": "git",
"url": "https://github.com/WordPress/packages.git"
},
"description": "WordPress's automatic paragraph functions `autop` and `removep`",
"main": "build/index.js",
"module": "build-module/index.js",
"author": "WordPress",
"license": "GPL-2.0+",
"publishConfig": {
"access": "public"
}
}
Loading

0 comments on commit 724b7c4

Please sign in to comment.