Closed zzzzBov closed 7 years ago
I think you are talking about the 'add page' modal?
This is powered by a JS library. we'll have to see if that can be configured.
I think you are talking about the 'add page' modal?
Yep
This is powered by a JS library
I've done a little digging, it looks like SpeakingURL can take a custom hash to customize how specific characters are converted.
The custom $.slugify
extension can be updated to pass the custom options by default:
$.slugify.options = {
custom: {
"'": ''
},
preSlug: null,
postSlug: null,
slugFunc: (input, opts) => getSlug(input, opts)
};
or add.js
can be updated to pass the custom options to slugify:
let slug = $.slugify(elements.title.val(), {custom: {"'": ''}});
I'd make a pull request but then I'd also have to rebuild the JS, and I don't feel like jumping through all those hoops at the moment.
Hope that helps, and thanks for your time!
Rebuilding JS is really not that bad, it's just a matter of doing an npm install
to install all the bits, then a gulp js
to build JS or gulp watch-js
to watch and build when changes occur.
let slug = $.slugify(elements.title.val(), {custom: {"'": ''}});
Yes please go ahead with the PR, that's exactly the kind of implementation I would do for your proposed enhancement. If you can't get the compilation going then just leave the PR allowing us to edit it and I'll recompile for you.
Thanks!
This was merged in a PR (#1178). Thanks @zzzzBov
Slugifying a name like "Can't touch this" produces "can-t-touch-this" because of how non-alphanumeric characters are translated.
Can apostrophes, and any other non-alphanumeric character that might appear mid-word be dropped rather than converted to hyphens?