Ticket #3259: prepopulate.diff

File prepopulate.diff, 669 bytes (added by Gary Wilson <gary.wilson@…>, 18 years ago)

patch is not tested, but uses \w in the regex of characters to exclude. \w is short for [a-zA-Z0-9_].

  • django/contrib/admin/media/js/urlify.js

    === modified file 'django/contrib/admin/media/js/urlify.js'
     
    77                  "with"];
    88    r = new RegExp('\\b(' + removelist.join('|') + ')\\b', 'gi');
    99    s = s.replace(r, '');
    10     s = s.replace(/[^-A-Z0-9\s]/gi, '');  // remove unneeded chars
     10    s = s.replace(/[^-\w\s]/g, '');  // remove unneeded chars
    1111    s = s.replace(/^\s+|\s+$/g, ''); // trim leading/trailing spaces
    1212    s = s.replace(/[-\s]+/g, '-');   // convert spaces to hyphens
    1313    s = s.toLowerCase();             // convert to lowercase
Back to Top