Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is it possible to treat # as a normal character (and not a "hash" prefix) on a route #738

Open
4www opened this issue Feb 22, 2022 · 0 comments

Comments

@4www
Copy link

4www commented Feb 22, 2022

Hello,

Have been using vaadin router in all my recent projects, and pretty happy with it, thanks!

Today, I fail to figure if it is possible to treat the # character (located as the first character of a route parameter), as a character, instead of the hash prefix.

In my use case, i'd like to find the id route param, from all routes after / starting with # or @ (i'm trying to map matrix/element room & user id, which have these two characters as prefix).

Links:

test 1

{path: '/:id', component: 'page-profile'}

It works if id starts with @, but not with #

test 2

{path: '/profile/#:room_id', component: 'page-profile'} # is not getting triggered, even if `#` is escaped in a regex query
{path: '/profile/@:user_id', component: 'page-profile'} # is getting triggered correctly

expected result

  • in the case example.com/profile/#matrix:matrix.org where room id is #matrix:matrix.org, the route param id, would have the values #matrix:matrix.org
    or in the case example.com/profile/@test-user:matrix.org, where a user id is @test-user:matrix.org, the route param user_id would have the value @test-user:matrix.org
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant