Skip to content

Commit

Permalink
percent-encode name
Browse files Browse the repository at this point in the history
  • Loading branch information
ja-he committed Jan 21, 2024
1 parent 76194bf commit 8b0fc0b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ leptos_meta = { version = "0.5.4", features = ["csr"] }
log = "0.4.20"
phosphor-leptos = "0.2.1"
regex = "1.10.2"
urlencoding = "2.1.3"

[dev-dependencies]
paste = "1.0"
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ fn MainContent() -> impl IntoView {
<div class="input-row">
<span class="input-label">"name"</span>
<input class="purl-component-input" type="text"
on:input=move |ev| { set_name(event_target_value(&ev)); }
prop:value=name
on:input=move |ev| { set_name(urlencoding::encode(&event_target_value(&ev)).into_owned()); }
prop:value=move || urlencoding::decode(&name()).unwrap_or_default().into_owned()
/>
</div>
<div class="input-row">
Expand Down

0 comments on commit 8b0fc0b

Please sign in to comment.