Skip to content

Commit f486539

Browse files
authored
Merge pull request #23 from parthpp/addApostropheToSpecials
Replace apostrophe with empty string (like github)
2 parents 9a212f0 + 1bb4a9a commit f486539

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module.exports = BananaSlug
44

55
var own = Object.hasOwnProperty
66
var whitespace = /\s/g
7-
var specials = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g
7+
var specials = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g
88

99
function BananaSlug () {
1010
var self = this

test/6-characters.md

+2
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@
1313
# initial space
1414

1515
# final space
16+
17+
# heading with apostrophe’s

test/index.js

+6
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ var testCases = [
102102
text: 'final space ',
103103
slug: 'final-space'
104104
},
105+
// Note: Apostrophe in heading is trimmed off in markdown
106+
{
107+
mesg: 'apostrophe’s should be trimmed',
108+
text: 'apostrophe’s should be trimmed',
109+
slug: 'apostrophes-should-be-trimmed'
110+
},
105111
// See `7-duplicates.md`
106112
{
107113
mesg: 'deals with duplicates correctly',

0 commit comments

Comments
 (0)