Ticket #1602: urlify-serbian-latin.patch

File urlify-serbian-latin.patch, 790 bytes (added by Petar Marić <petar.maric@…>, 19 years ago)

Example of the patch for Serbian (Latin)

  • urlify.js

     
    77                  "with"];
    88    r = new RegExp('\\b(' + removelist.join('|') + ')\\b', 'gi');
    99    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
    1018    s = s.replace(/[^-A-Z0-9\s]/gi, '');  // remove unneeded chars
    1119    s = s.replace(/^\s+|\s+$/g, ''); // trim leading/trailing spaces
    1220    s = s.replace(/\s+/g, '-');      // convert spaces to hyphens
Back to Top