Fix ASCII spaces
This commit is contained in:
parent
e813d3e5ba
commit
d9f754ad57
@ -61,8 +61,8 @@ const ConvertBase: Component = () => {
|
|||||||
//const [base64, setBase64] = createSignal('');
|
//const [base64, setBase64] = createSignal('');
|
||||||
const [ascii, setAscii] = createSignal('');
|
const [ascii, setAscii] = createSignal('');
|
||||||
|
|
||||||
function updateExcept(value: string, base: number, except: Setter<string>) {
|
function updateExcept(value: string, base: number, except: Setter<string>, preserveSpaces: boolean = true) {
|
||||||
const raw = value.replaceAll(/ /g, '');
|
const raw = preserveSpaces ? value : value.replaceAll(/ /g, '');
|
||||||
|
|
||||||
setError('');
|
setError('');
|
||||||
|
|
||||||
@ -131,7 +131,7 @@ const ConvertBase: Component = () => {
|
|||||||
{/*<h2>Base 64</h2>
|
{/*<h2>Base 64</h2>
|
||||||
<textarea value={base64()} oninput={e => updateExcept(e.currentTarget.value, 64, setBase64)} />*/}
|
<textarea value={base64()} oninput={e => updateExcept(e.currentTarget.value, 64, setBase64)} />*/}
|
||||||
<h2>ASCII</h2>
|
<h2>ASCII</h2>
|
||||||
<textarea value={ascii()} oninput={e => updateExcept(e.currentTarget.value, 256, setAscii)} />
|
<textarea value={ascii()} oninput={e => updateExcept(e.currentTarget.value, 256, setAscii, true)} />
|
||||||
</Page >
|
</Page >
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user