diff --git a/bower.json b/bower.json index 78ed1bfe..fc10c65f 100644 --- a/bower.json +++ b/bower.json @@ -20,7 +20,7 @@ "bootstrap-tour": "~0.6.0", "ace": "#51b7cb67a63998c9c0b7d089a85c60e032a7cc17", "pagedown-ace": "git@github.com:benweet/pagedown-ace.git#7805f240f343b5b2a05a5b9c0d4a3f5091e7a49b", - "pagedown-extra": "git@github.com:jmcmanus/pagedown-extra.git#cca554948c362affb1cbab3bacc3861e2d90d426", + "pagedown-extra": "git@github.com:jmcmanus/pagedown-extra.git#ae1547d1662e07d6530137bd3dff3a6e6c8aec3b", "crel": "git@github.com:KoryNunn/crel.git#8dbda04b129fc0aec01a2a080d1cab26816e11c1", "waitForImages": "git@github.com:alexanderdickson/waitForImages.git#~1.4.2", "to-markdown": "git@github.com:benweet/to-markdown.git#jquery", diff --git a/public/res/utils.js b/public/res/utils.js index 40daafa3..a2acb0a8 100644 --- a/public/res/utils.js +++ b/public/res/utils.js @@ -148,12 +148,10 @@ define([ }; // Slug function + var nonWordChars = XRegExp('[^\\p{L}-]', 'g'); utils.slugify = function(text) { return text.toLowerCase().replace(/\s/g, '-') // Replace spaces with - - .replace(XRegExp('[^\\p{L}]', 'g'), '') // Remove - // all - // non-word - // chars + .replace(nonWordChars, '') // Remove all non-word chars .replace(/\-\-+/g, '-') // Replace multiple - with single - .replace(/^-+/, '') // Trim - from start of text .replace(/-+$/, ''); // Trim - from end of text