diff --git a/src/routes/edit/[slug].svelte b/src/routes/edit/[slug].svelte index e233fd48..0420b804 100644 --- a/src/routes/edit/[slug].svelte +++ b/src/routes/edit/[slug].svelte @@ -47,10 +47,7 @@ async function submitEntry() { // make a put request to /api/entry/.json // if successful, redirect to /entry/ - entryTags = entryTags.split(',') - if (entryTags.length == 1 && entryTags[0] == '') { - entryTags = [] - } + entryTags = entryTags.split(',').map(tag => tag.trim()).filter(tag => tag.length > 0) const response: Entry | { error: string } = await fetch(`/api/entry/${entry.id}.json`, { method: 'PUT', headers: {