diff --git a/src/components/atoms/Tags.tsx b/src/components/atoms/Tags.tsx index c6950ec87..92b07e4c8 100644 --- a/src/components/atoms/Tags.tsx +++ b/src/components/atoms/Tags.tsx @@ -12,11 +12,12 @@ declare type TagsProps = { } const Tag = ({ tag, noLinks }: { tag: string; noLinks?: boolean }) => { + const urlEncodedTag = encodeURIComponent(tag) return noLinks ? ( {tag} ) : ( diff --git a/src/components/molecules/SearchBar.tsx b/src/components/molecules/SearchBar.tsx index 5486d8c74..c3112493d 100644 --- a/src/components/molecules/SearchBar.tsx +++ b/src/components/molecules/SearchBar.tsx @@ -26,8 +26,9 @@ export default function SearchBar({ async function startSearch(e: FormEvent) { e.preventDefault() if (value === '') return + const urlEncodedValue = encodeURIComponent(value) const url = await addExistingParamsToUrl(location, 'text') - navigate(`${url}&text=${value}`) + navigate(`${url}&text=${urlEncodedValue}`) } return (