added all files to project

This commit is contained in:
2022-03-10 10:36:59 +01:00
parent 09dd957b33
commit 46a936d7de
25351 changed files with 3883356 additions and 0 deletions
@@ -0,0 +1,9 @@
'use strict'
const br2nl = require('.')
console.log(br2nl('foo<br>bar'))
console.log(br2nl('foo<br> bar'))
console.log(br2nl('foo<br/>bar'))
console.log(br2nl('foo<br />bar'))
console.log(br2nl('foo<br a="b" />bar'))
@@ -0,0 +1,7 @@
'use strict'
const regex = /<br\b[^>]*>/gi
const br2nl = html => html.replace(regex, '\n')
module.exports = br2nl
@@ -0,0 +1,5 @@
Copyright (c) 2018, Jannis R
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -0,0 +1,62 @@
{
"_from": "@derhuerst/br2nl@^1.0.0",
"_id": "@derhuerst/br2nl@1.0.0",
"_inBundle": false,
"_integrity": "sha512-aGzqSMKM9eqHd9orDSe7yOvekRM9EMt9Jbc9vAG+a3jbn50WOTThVQX20c75yk0WBmu+6A5hdHGRM49dlp0I9w==",
"_location": "/@derhuerst/br2nl",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@derhuerst/br2nl@^1.0.0",
"name": "@derhuerst/br2nl",
"escapedName": "@derhuerst%2fbr2nl",
"scope": "@derhuerst",
"rawSpec": "^1.0.0",
"saveSpec": null,
"fetchSpec": "^1.0.0"
},
"_requiredBy": [
"/hafas-client"
],
"_resolved": "https://registry.npmjs.org/@derhuerst/br2nl/-/br2nl-1.0.0.tgz",
"_shasum": "e2d18fd5ebbae8fa27b31e2f24bac846873fa895",
"_spec": "@derhuerst/br2nl@^1.0.0",
"_where": "/home/pi/MagicMirror/modules/MMM-PublicTransportHafas/node_modules/hafas-client",
"author": {
"name": "Jannis R",
"email": "mail@jannisr.de"
},
"bugs": {
"url": "https://github.com/derhuerst/br2nl/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Replace HTML <br> tags with newline characters.",
"engines": {
"node": ">=6"
},
"files": [
"index.js",
"example.js"
],
"homepage": "https://github.com/derhuerst/br2nl",
"keywords": [
"br2nl",
"br",
"break",
"newline"
],
"license": "ISC",
"main": "index.js",
"name": "@derhuerst/br2nl",
"repository": {
"type": "git",
"url": "git+https://github.com/derhuerst/br2nl.git"
},
"scripts": {
"prepublishOnly": "npm test",
"test": "env NODE_ENV=dev node test.js"
},
"version": "1.0.0"
}
@@ -0,0 +1,36 @@
# br2nl
Yet another function to **replace HTML `<br>` 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 `<br>`.
[![npm version](https://img.shields.io/npm/v/br2nl.svg)](https://www.npmjs.com/package/br2nl)
[![build status](https://api.travis-ci.org/derhuerst/br2nl.svg?branch=master)](https://travis-ci.org/derhuerst/br2nl)
![ISC-licensed](https://img.shields.io/github/license/derhuerst/br2nl.svg)
[![chat with me on Gitter](https://img.shields.io/badge/chat%20with%20me-on%20gitter-512e92.svg)](https://gitter.im/derhuerst)
[![support me on Patreon](https://img.shields.io/badge/support%20me-on%20patreon-fa7664.svg)](https://patreon.com/derhuerst)
## Installation
```shell
npm install @derhuerst/br2nl
```
## Usage
```js
const br2nl = require('@derhuerst/br2nl')
console.log(br2nl('foo<br>bar'))
console.log(br2nl('foo<br> bar'))
console.log(br2nl('foo<br/>bar'))
console.log(br2nl('foo<br />bar'))
console.log(br2nl('foo<br a="b" />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).