Skip to main content

Bug Tracker

Side navigation

#5696 closed enhancement (wontfix)

Opened December 22, 2009 01:31AM UTC

Closed March 09, 2010 02:07PM UTC

Minor Feature: Slugify

Reported by: umbrae Owned by:
Priority: trivial Milestone: 1.4
Component: unfiled Version: 1.3.2
Keywords: Cc: umbrae@gmail.com
Blocked by: Blocking:
Description

Not a huge deal, but I find a function to turn text into a URL friendly slug like this often useful:

jQuery.slugify = function(s) {
	return s.replace(/\\s+/g,'-').replace(/[^a-zA-Z0-9\\-]/g,'').toLowerCase();
}

Might be worth sticking into jQuery core for everyone else. (Although I know that string operations are extremely sparse in the jQuery framework. Only trim() as far as I know.)

If this is worth a patch, I can spend the minute and turn it into one. Let me know.

Attachments (0)
Change History (1)

Changed March 09, 2010 02:07PM UTC by john comment:1

resolution: → wontfix
status: newclosed

This isn't something that we're going to be landing - should make for a fine plugin, though.