https://github.com/derhuerst/br2nl
Yet another function to replace HTML <br> tags with newline characters.
https://github.com/derhuerst/br2nl
br2nl break html newline
Last synced: 10 months ago
JSON representation
Yet another function to replace HTML <br> tags with newline characters.
- Host: GitHub
- URL: https://github.com/derhuerst/br2nl
- Owner: derhuerst
- License: isc
- Created: 2019-04-29T14:05:39.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-01T22:01:12.000Z (over 6 years ago)
- Last Synced: 2025-08-08T15:33:17.618Z (10 months ago)
- Topics: br2nl, break, html, newline
- Language: JavaScript
- Homepage: https://github.com/derhuerst/br2nl#br2nl
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# br2nl
Yet another function to **replace HTML `
` tags with [newline characters](https://en.wikipedia.org/wiki/Newline)**.
*Note:* This package does *not* do [HTML sanitization](https://en.wikipedia.org/wiki/HTML_sanitization)! It merely replaces `
`.
[](https://www.npmjs.com/package/br2nl)
[](https://travis-ci.org/derhuerst/br2nl)

[](https://gitter.im/derhuerst)
[](https://patreon.com/derhuerst)
## Installation
```shell
npm install @derhuerst/br2nl
```
## Usage
```js
const br2nl = require('@derhuerst/br2nl')
console.log(br2nl('foo
bar'))
console.log(br2nl('foo
bar'))
console.log(br2nl('foo
bar'))
console.log(br2nl('foo
bar'))
console.log(br2nl('foo
bar'))
```
## Contributing
If you have a question or need support using `br2nl`, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to [the issues page](https://github.com/derhuerst/br2nl/issues).