fix(frontend): allow more special characters in search input

fixes #430
This commit is contained in:
sct
2020-12-21 18:02:23 +09:00
parent 6753d9daaa
commit 5deb64a87f
2 changed files with 24 additions and 2 deletions

View File

@@ -7,8 +7,20 @@ import type { Nullable } from '../utils/typeHelpers';
type Url = string | UrlObject;
const extraEncodes: [RegExp, string][] = [
[/\(/g, '%28'],
[/\)/g, '%29'],
[/!/g, '%21'],
];
const encodeURIExtraParams = (string: string): string => {
return encodeURIComponent(string).replace(/!/g, '%21');
let finalString = encodeURIComponent(string);
extraEncodes.forEach((encode) => {
finalString = finalString.replace(encode[0], encode[1]);
});
return finalString;
};
interface SearchObject {