From c9fcb512479d6dc39b92430406430d1fccc9f836 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sun, 25 Oct 2020 20:21:52 -0700 Subject: [PATCH] When normalizing tag names, collapse whitespace to 1 space. --- etiquette/objects.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/etiquette/objects.py b/etiquette/objects.py index 91c0bb3..0703caa 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -5,6 +5,7 @@ but are returned by the PDB accesses. import abc import os import PIL.Image +import re import send2trash import traceback @@ -1275,6 +1276,7 @@ class Tag(ObjectBase, GroupableMixin): name = name.lower() name = helpers.remove_control_characters(name) + name = re.sub(r'\s+', ' ', name) name = name.strip(' .+') name = name.split('+')[0].split('.')[-1] name = name.replace('-', '_')