Compare commits
1 Commits
main
...
unescaping
Author | SHA1 | Date |
---|---|---|
Greg Johnston | 68a281f7ba |
|
@ -435,7 +435,7 @@ impl RouterContextInner {
|
|||
}
|
||||
|
||||
let url = Url::try_from(href.as_str()).unwrap();
|
||||
let path_name = unescape(&url.pathname);
|
||||
let path_name = crate::history::unescape_minimal(&url.pathname);
|
||||
|
||||
// let browser handle this event if it leaves our domain
|
||||
// or our base path
|
||||
|
|
|
@ -28,6 +28,11 @@ pub fn unescape(s: &str) -> String {
|
|||
js_sys::decode_uri_component(s).unwrap().into()
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "ssr"))]
|
||||
pub fn unescape_minimal(s: &str) -> String {
|
||||
js_sys::decode_uri(s).unwrap().into()
|
||||
}
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
pub fn escape(s: &str) -> String {
|
||||
percent_encoding::utf8_percent_encode(s, percent_encoding::NON_ALPHANUMERIC)
|
||||
|
|
Loading…
Reference in New Issue