Skip to content

Commit

Permalink
Add a constant to toggle the display with Markdown rather than BBCode
Browse files Browse the repository at this point in the history
  • Loading branch information
woctezuma committed Jan 1, 2025
1 parent 924a172 commit 960be2c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions igdb_match_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
from load_ballots import load_ballots
from my_types import Ballots

USE_MARKDOWN_DISPLAY = True


def get_link_to_igdb_website(
igdb_id: int | str,
Expand All @@ -29,9 +31,12 @@ def get_link_to_igdb_website(
slug = igdb_data["slug"]

if int(igdb_id) > 0:
link_to_store = (
"[URL=" + igdb_base_url + slug + "/]" + igdb_id_as_str + "[/URL]"
)
if USE_MARKDOWN_DISPLAY:
link_to_store = f"[{igdb_id_as_str}]({igdb_base_url}{slug}/)"
else:
link_to_store = (
"[URL=" + igdb_base_url + slug + "/]" + igdb_id_as_str + "[/URL]"
)
elif hide_dummy_app_id:
link_to_store = "n/a"
else:
Expand Down

0 comments on commit 960be2c

Please sign in to comment.