@ditojs/utils
Advanced tools
+2
-2
| { | ||
| "name": "@ditojs/utils", | ||
| "version": "2.74.0", | ||
| "version": "2.75.0", | ||
| "type": "module", | ||
@@ -42,3 +42,3 @@ "description": "Dito.js Utility Functions – Dito.js is a declarative and modern web framework, based on Objection.js, Koa.js and Vue.js", | ||
| }, | ||
| "gitHead": "26c5b4bd33d1bc469c8b621a214ae3c8f0927c11" | ||
| "gitHead": "cfc4ee21dc3f5808b5a78a3b1fab83500c05907a" | ||
| } |
@@ -7,4 +7,6 @@ import { deprecate } from '../function/deprecate.js' | ||
| .toString() | ||
| .replace(/<br\/?>/gi, '\n') | ||
| .replace(/<br\s*\/?>/gi, '\n') | ||
| .replace(/<\/p>/gi, '\n') | ||
| .replace(/<[^>]+>/g, '') | ||
| .trim() | ||
| : '' | ||
@@ -11,0 +13,0 @@ } |
@@ -23,3 +23,16 @@ import { stripHtml } from './stripHtml.js' | ||
| expect(stripHtml('hello<br/>world')).toBe('hello\nworld') | ||
| expect(stripHtml('hello<br />world')).toBe('hello\nworld') | ||
| }) | ||
| it('should convert <p> tags to line-breaks', () => { | ||
| expect(stripHtml('<p>First paragraph</p><p>Second paragraph</p>')) | ||
| .toBe('First paragraph\nSecond paragraph') | ||
| expect(stripHtml('<p>Only paragraph</p>')) | ||
| .toBe('Only paragraph') | ||
| }) | ||
| it('should trim leading and trailing whitespace', () => { | ||
| expect(stripHtml(' <p>text</p> ')).toBe('text') | ||
| expect(stripHtml('<p> text </p>')).toBe('text') | ||
| }) | ||
| }) |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
160635
0.34%6015
0.22%