next-routes icon indicating copy to clipboard operation
next-routes copied to clipboard

Why characters like š aren't matched?

Open hkirsman opened this issue 5 years ago • 1 comments

Not sure if this is bug or support request. I can't seem to catch 'š' character with routes. So path like /tsitaadid/autorid/š doesn't match the rule.

Whatever I try in routes.js, even adding š character, it just skips the first route. Ascii chars work just fine.

module.exports = routes()
    .add('quotes/authors/%author_last_name_first_char', '/tsitaadid/autorid/(.)', 'quotes/authors')
    .add('quotes/authors/%author_name', '/tsitaadid/autorid/:author_name/:quote_id?', 'quotes/author-quotes');

or

module.exports = routes()
    .add('quotes/authors/%author_last_name_first_char', '/tsitaadid/autorid/(\\w{1})', 'quotes/authors')
    .add('quotes/authors/%author_name', '/tsitaadid/autorid/:author_name/:quote_id?', 'quotes/author-quotes');

or

module.exports = routes()
    .add('quotes/authors/%author_last_name_first_char', '/tsitaadid/autorid/š', 'quotes/authors')
    .add('quotes/authors/%author_name', '/tsitaadid/autorid/:author_name/:quote_id?', 'quotes/author-quotes');

I guess I could pass it all to page and check there the length of last parameter in component.

hkirsman avatar May 11 '19 09:05 hkirsman

Hello @hkirsman , maybe you need to check the path-to-regexp

alanhr avatar May 24 '19 19:05 alanhr