remove-markdown
Advanced tools
Comparing version 0.2.1 to 0.2.2
@@ -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'; |
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
11713
176