Make tag parsing more robust

This commit is contained in:
Mark Veidemanis 2022-08-11 23:17:45 +01:00
parent 7791e96809
commit 733ca0eef3
Signed by: m
GPG Key ID: 5ACFCEED46C0904F
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ def create_tags(query):
spl = query.split("AND") spl = query.split("AND")
spl = [x.strip() for x in spl if ":" in x] spl = [x.strip() for x in spl if ":" in x]
spl = [x.replace('"', "") for x in spl] spl = [x.replace('"', "") for x in spl]
tags = [f"{tag}: {elem}" for tag, elem in [x.split(":") for x in spl]] tags = [f"{tag}: {elem}" for tag, elem in [x.split(":")[:2] for x in spl]]
return tags return tags