@magicbell/magicbell-react
Advanced tools
Comparing version 5.1.1-beta.4 to 5.1.1-beta.5
@@ -76,5 +76,2 @@ "use strict"; | ||
if (data.tagName === 'p' && ((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.includes('####'))) { | ||
var br = node.nextElementSibling; | ||
if ((br === null || br === void 0 ? void 0 : br.tagName) === 'BR') | ||
br.setAttribute('style', 'display: none'); | ||
return (_b = node.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(node); | ||
@@ -84,4 +81,4 @@ } | ||
var sanitized = dompurify_1.default.sanitize(html, { FORBID_ATTR: ['style'], FORBID_TAGS: ['style', 'img', 'svg', 'br'] }); | ||
return text_clipper_1.default(sanitized, 200, { html: true }); | ||
return text_clipper_1.default(sanitized, 200, { html: true, maxLines: 3 }); | ||
} | ||
exports.sanitizeHTML = sanitizeHTML; |
@@ -69,5 +69,2 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
if (data.tagName === 'p' && ((_a = node.textContent) === null || _a === void 0 ? void 0 : _a.includes('####'))) { | ||
var br = node.nextElementSibling; | ||
if ((br === null || br === void 0 ? void 0 : br.tagName) === 'BR') | ||
br.setAttribute('style', 'display: none'); | ||
return (_b = node.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(node); | ||
@@ -77,3 +74,3 @@ } | ||
var sanitized = DOMPurify.sanitize(html, { FORBID_ATTR: ['style'], FORBID_TAGS: ['style', 'img', 'svg', 'br'] }); | ||
return clip(sanitized, 200, { html: true }); | ||
return clip(sanitized, 200, { html: true, maxLines: 3 }); | ||
} |
{ | ||
"name": "@magicbell/magicbell-react", | ||
"version": "5.1.1-beta.4", | ||
"version": "5.1.1-beta.5", | ||
"description": "A set of React components to build a notification inbox", | ||
@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js", |
import DOMPurify from 'dompurify'; | ||
import { Liquid } from 'liquidjs'; | ||
import clip from 'text-clipper'; | ||
/** | ||
@@ -24,5 +25,2 @@ * Function to compile a template with Liquid. | ||
if (data.tagName === 'p' && node.textContent?.includes('####')) { | ||
const br = node.nextElementSibling; | ||
if (br?.tagName === 'BR') br.setAttribute('style', 'display: none'); | ||
return node.parentNode?.removeChild(node); | ||
@@ -33,3 +31,3 @@ } | ||
const sanitized = DOMPurify.sanitize(html, { FORBID_ATTR: ['style'], FORBID_TAGS: ['style', 'img', 'svg', 'br'] }); | ||
return clip(sanitized, 200, { html: true }); | ||
return clip(sanitized, 200, { html: true, maxLines: 3 }); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
631551
10075