Ticket #1602: urlify-serbian-latin.patch
File urlify-serbian-latin.patch, 790 bytes (added by , 19 years ago) |
---|
-
urlify.js
7 7 "with"]; 8 8 r = new RegExp('\\b(' + removelist.join('|') + ')\\b', 'gi'); 9 9 s = s.replace(r, ''); 10 11 //Change the behaviour of urlify so it accepts Serbian letters 12 s = s.replace(/Š/gi, 's'); // Š->s 13 s = s.replace(/Đ/gi, 'dj'); // Đ->dj 14 s = s.replace(/Ž/gi, 'z'); // Ž->z 15 s = s.replace(/Č/gi, 'c'); // Č->c 16 s = s.replace(/Ć/gi, 'c'); // Ć->c 17 10 18 s = s.replace(/[^-A-Z0-9\s]/gi, ''); // remove unneeded chars 11 19 s = s.replace(/^\s+|\s+$/g, ''); // trim leading/trailing spaces 12 20 s = s.replace(/\s+/g, '-'); // convert spaces to hyphens