diff --git a/index.js b/index.js index e5475e1..d281924 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ module.exports = BananaSlug var own = Object.hasOwnProperty var whitespace = /\s/g -var specials = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g +var specials = /[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~’]/g function BananaSlug () { var self = this diff --git a/test/6-characters.md b/test/6-characters.md index 0cc32b5..61d826c 100644 --- a/test/6-characters.md +++ b/test/6-characters.md @@ -13,3 +13,5 @@ # initial space # final space + +# heading with apostrophe’s diff --git a/test/index.js b/test/index.js index f29e75a..6785e09 100644 --- a/test/index.js +++ b/test/index.js @@ -102,6 +102,12 @@ var testCases = [ text: 'final space ', slug: 'final-space' }, + // Note: Apostrophe in heading is trimmed off in markdown + { + mesg: 'apostrophe’s should be trimmed', + text: 'apostrophe’s should be trimmed', + slug: 'apostrophes-should-be-trimmed' + }, // See `7-duplicates.md` { mesg: 'deals with duplicates correctly',