mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-31 18:27:30 +01:00
Fix hypertext escaping of game links
This commit is contained in:
parent
f77ecd824c
commit
686d285731
@ -241,7 +241,7 @@ def package_info_as_hypertext(package: Package, formspec_version: int = 7):
|
|||||||
|
|
||||||
def add_value(label, value):
|
def add_value(label, value):
|
||||||
nonlocal body
|
nonlocal body
|
||||||
body += f"{label}: <b>{escape_hypertext(str(value))}</b>\n\n"
|
body += f"{label}: <b>{str(value)}</b>\n\n"
|
||||||
|
|
||||||
def add_list(label, items):
|
def add_list(label, items):
|
||||||
nonlocal body
|
nonlocal body
|
||||||
@ -250,10 +250,10 @@ def package_info_as_hypertext(package: Package, formspec_version: int = 7):
|
|||||||
for i, item in enumerate(items):
|
for i, item in enumerate(items):
|
||||||
if i != 0:
|
if i != 0:
|
||||||
body += ", "
|
body += ", "
|
||||||
body += f"<b>{escape_hypertext(str(item))}</b>"
|
body += f"<b>{str(item)}</b>"
|
||||||
|
|
||||||
if len(items) == 0:
|
if len(items) == 0:
|
||||||
body += "<i>" + escape_hypertext(gettext("none")) + "</i>"
|
body += "<i>" + gettext("none") + "</i>"
|
||||||
|
|
||||||
body += "</b>\n\n"
|
body += "</b>\n\n"
|
||||||
|
|
||||||
@ -264,7 +264,7 @@ def package_info_as_hypertext(package: Package, formspec_version: int = 7):
|
|||||||
def make_game_link(game):
|
def make_game_link(game):
|
||||||
key = f"link_{len(links)}"
|
key = f"link_{len(links)}"
|
||||||
links[key] = game.get_url("packages.view", absolute=True)
|
links[key] = game.get_url("packages.view", absolute=True)
|
||||||
return f"<action name={key}><u>{game.title}</u></action>"
|
return f"<action name={key}><u>{escape_hypertext(game.title)}</u></action>"
|
||||||
|
|
||||||
[supported, unsupported] = package.get_sorted_game_support_pair()
|
[supported, unsupported] = package.get_sorted_game_support_pair()
|
||||||
supports_all_games = package.supports_all_games or len(supported) == 0
|
supports_all_games = package.supports_all_games or len(supported) == 0
|
||||||
|
Loading…
Reference in New Issue
Block a user