An open API service indexing awesome lists of open source software.

https://github.com/mattecapu/react-markup-text

add <p>s and <br/>s to texts
https://github.com/mattecapu/react-markup-text

Last synced: 5 months ago
JSON representation

add <p>s and <br/>s to texts

Awesome Lists containing this project

README

          

# react-markup-text
### markup texts with React

Use this package to add paragraphs and line endings to unstructured text

## Install
```
npm install --save react-markup-text
```

## Usage
```js
import textToReactMarkup from 'react-markup-text';

function BlogArticle({ title, author, body }) {
return (

{title}




{textToReactMarkup(body)}


);
}
```

## API

#### `textToReactMarkup(text: string) : Array`

The implementation is really simple, `\n\n` creates a new paragraph and `\n` a new line.

## License
ISC