leptos-rs / leptos

Build fast web applications with Rust.
https://leptos.dev
MIT License
15.96k stars 627 forks source link

fix: do not unescape / and other route characters when following a link #2651

Closed gbj closed 3 months ago

gbj commented 3 months ago

Resolves the need for both #2602 and the following to work:

#[component]
pub fn App() -> impl IntoView {
    view! {
      <Router>
        <nav>
          <a href="/file/demo">This link matches</a><br/>
          <a href="/file/demo%2Ftest">"This link doesn't match"</a>
        </nav>
        <main>
          <Routes>
            <Route path="/" view=|| view!{ <h1>Home</h1> }/>
            <Route path="/file/:id" view=|| view!{<h1>File match!</h1>}/>
            <Route path="/*any" view=|| view! { <h1>Any</h1> }/>
          </Routes>
        </main>
      </Router>
    }
}