Browse Source

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
master
Trent Palmer 1 year ago
parent
commit
6965a1bae9
1 changed files with 2 additions and 1 deletions
  1. +2
    -1
      rank_hugo_themes.py

+ 2
- 1
rank_hugo_themes.py View File

@ -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]


Loading…
Cancel
Save