Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@alexandermacarthur/strip-html
Advanced tools
Readme
:warning: This package was forked from Codesen's version of it, for the purpose of making it consumable via CommonJS.
Strips HTML tags from strings. No parser, accepts mixed sources.
This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required:
npm i string-strip-html
If you need a legacy version which works with require
, use version 8.3.0
import { strict as assert } from "assert";
import { stripHtml } from "string-strip-html";
assert.equal(
stripHtml(`Some text <b>and</b> text.`).result,
`Some text and text.`
);
// prevents accidental string concatenation
assert.equal(stripHtml(`aaa<div>bbb</div>ccc`).result, `aaa bbb ccc`);
// tag pairs with content, upon request
assert.equal(
stripHtml(`a <pre><code>void a;</code></pre> b`, {
stripTogetherWithTheirContents: [
"script", // default
"style", // default
"xml", // default
"pre", // <-- custom-added
],
}).result,
`a b`
);
// detects raw, legit brackets:
assert.equal(stripHtml(`a < b and c > d`).result, `a < b and c > d`);
Please visit codsen.com for a full description of the API and examples.
To report bugs or request features or assistance, raise an issue on GitHub.
MIT License
Copyright (c) 2010-2021 Roy Revelt and other contributors
FAQs
Strips HTML tags from strings. No parser, accepts mixed sources.
The npm package @alexandermacarthur/strip-html receives a total of 19 weekly downloads. As such, @alexandermacarthur/strip-html popularity was classified as not popular.
We found that @alexandermacarthur/strip-html demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.