mirror of
https://github.com/placeAtlas/atlas.git
synced 2024-12-26 05:14:06 +01:00
Adapt ARP's url fix
Co-authored-by: Cheng Hann Gan <chenghanngan.us@gmail.com>
This commit is contained in:
parent
3a86822175
commit
b5aa228962
1 changed files with 11 additions and 0 deletions
|
@ -88,6 +88,15 @@ def fix_r_caps(entry: dict):
|
|||
|
||||
return entry
|
||||
|
||||
def fix_no_protocol_urls(entry: dict):
|
||||
if not "website" in entry:
|
||||
return entry
|
||||
|
||||
if entry["website"].startswith("http"):
|
||||
entry["website"] = "https://" + entry["website"]
|
||||
|
||||
return entry
|
||||
|
||||
def per_line_entries(entries: list):
|
||||
out = "[\n"
|
||||
for entry in entries:
|
||||
|
@ -103,6 +112,8 @@ def print_(*args, **kwargs):
|
|||
entry = remove_extras(entry)
|
||||
print_("Fixing r/ capitalization...")
|
||||
entry = fix_r_caps(entry)
|
||||
print_("Fixing links without protocol...")
|
||||
entry = fix_no_protocol_urls(entry)
|
||||
print_("Collapsing Markdown links...")
|
||||
entry = collapse_links(entry)
|
||||
print_("Fix formatting of subreddit...")
|
||||
|
|
Loading…
Reference in a new issue