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