diff --git a/hotdog/command/urlinfo_/generic.py b/hotdog/command/urlinfo_/generic.py index c59fad1..4010877 100644 --- a/hotdog/command/urlinfo_/generic.py +++ b/hotdog/command/urlinfo_/generic.py @@ -39,12 +39,16 @@ def generic_details(info, url: str): text = "" if info.extracted.title: - text += f"{info.extracted.title} — " + text += f'{info.extracted.title} — ' text += "; ".join(details) return text -def ld_details(ex, tz, lc): +def ld_details(info, tz, lc): + escape_all(info) + ex = info.extracted.ld + url = info.final_url + details = [] if ex.creators: details.append(f"🖋 {' ∕ '.join(ex.creators[:2])}") @@ -53,7 +57,7 @@ def ld_details(ex, tz, lc): lines = [] if ex.title: - lines.append(f"{ex.title}") + lines.append(f'{ex.title}') if ex.published: lines[ -1 @@ -76,9 +80,7 @@ async def handle(message: Message, url, load_info): roomconf = message.app.config.l6n[message.room.room_id] plain = html = None if info.extracted.ld and info.extracted.ld.description: - html, plain = ld_details( - info.extracted.ld, tz=roomconf["timezone"], lc=roomconf["locale"] - ) + html, plain = ld_details(info, tz=roomconf["timezone"], lc=roomconf["locale"]) else: html = generic_details(info, url)