From 6965a1bae9bcd3cf9c114f38cc19c16b250b4ecd Mon Sep 17 00:00:00 2001 From: Trent Palmer Date: Fri, 14 Feb 2020 15:42:20 -0800 Subject: [PATCH] add \n after regex substitution that adds quotes after double-dotted version numbers because toml module doesn't handle double-dotted version numbers that aren't quoted --- rank_hugo_themes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rank_hugo_themes.py b/rank_hugo_themes.py index 37584f2..eafa756 100755 --- a/rank_hugo_themes.py +++ b/rank_hugo_themes.py @@ -432,8 +432,9 @@ def update_tags_list_for_each_hugo_themes(): if theme.themes_toml_content != None: content = b64decode(theme.themes_toml_content).decode('utf-8') # put quotes around any unquoted double-dotted version numbers + # (and add a newline afterwards) # because python toml libraries will error out on those - theme_toml = toml.loads(match.sub(r'"\1"',content)) + theme_toml = toml.loads(match.sub(r'"\1"\n',content)) if 'tags' in theme_toml: if len(theme_toml['tags']) > 0: theme_tags = [tag.lower() for tag in theme_toml['tags'] if len(tag) > 0]