From 90d35f44f957d137f7d442cd0687caef9376f452 Mon Sep 17 00:00:00 2001 From: Borja Robert Date: Thu, 29 Sep 2022 11:46:41 +0200 Subject: [PATCH] lidia con los nombres de ciudadades con espacios a la hora de poner nombre a los archivos --- src/lib/form/Form.svelte | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/form/Form.svelte b/src/lib/form/Form.svelte index 473fa89..641a9da 100644 --- a/src/lib/form/Form.svelte +++ b/src/lib/form/Form.svelte @@ -15,7 +15,6 @@ } from '$lib/stores/store'; /** @type {HTMLDivElement} */ let editor; - /** @type {HTMLDivElement} */ let editor2; const handleSubmit = async () => { console.log('submit'); @@ -38,7 +37,10 @@ const image = res.toDataURL('image/png'); const link = document.createElement('a'); const city = $address.split('\n'); - link.download = `${$date.split('T')[0]}-${city[city.length - 1]}-cartel.png`; + link.download = `${$date.split('T')[0]}-${city[city.length - 1].replace( + ' ', + '_' + )}-cartel.png`; link.href = image; link.click(); }