Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

remove-markdown

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remove-markdown - npm Package Compare versions

Comparing version 0.2.1 to 0.2.2

4

index.js

@@ -40,4 +40,4 @@ module.exports = function(md, options) {

.replace(/\[(.*?)\][\[\(].*?[\]\)]/g, '$1')
// Remove Blockquotes
.replace(/>/g, '')
// Remove blockquotes
.replace(/^\s{0,3}>\s?/g, '')
// Remove reference-style links?

@@ -44,0 +44,0 @@ .replace(/^\s{1,2}\[(.*?)\]: (\S+)( ".*?")?\s*$/g, '')

{
"name": "remove-markdown",
"version": "0.2.1",
"version": "0.2.2",
"description": "Remove Markdown formatting from text",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -70,3 +70,3 @@ 'use strict';

expect(removeMd(string)).to.equal(expected);
});
});

@@ -85,2 +85,39 @@ it('should remove horizontal rules', function () {

it('should remove blockquotes', function () {
const string = '>I am a blockquote';
const expected = 'I am a blockquote';
expect(removeMd(string)).to.equal(expected);
});
it('should remove blockquotes with spaces', function () {
const string = '> I am a blockquote';
const expected = 'I am a blockquote';
expect(removeMd(string)).to.equal(expected);
});
it('should remove indented blockquotes', function () {
var tests = [
{ string: ' > I am a blockquote', expected: 'I am a blockquote' },
{ string: ' > I am a blockquote', expected: 'I am a blockquote' },
{ string: ' > I am a blockquote', expected: 'I am a blockquote' },
];
tests.forEach(function (test) {
expect(removeMd(test.string)).to.equal(test.expected);
});
});
it('should not remove greater than signs', function () {
var tests = [
{ string: '100 > 0', expected: '100 > 0' },
{ string: '100 >= 0', expected: '100 >= 0' },
{ string: '100>0', expected: '100>0' },
{ string: '> 100 > 0', expected: '100 > 0' },
{ string: '1 < 100', expected: '1 < 100' },
{ string: '1 <= 100', expected: '1 <= 100' },
];
tests.forEach(function (test) {
expect(removeMd(test.string)).to.equal(test.expected);
});
});
it('should strip unordered list leaders', function () {

@@ -87,0 +124,0 @@ const string = 'Some text on a line\n\n* A list Item\n* Another list item';

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc