fix embed link

This commit is contained in:
Markus-Rost 2020-12-05 23:12:09 +01:00
parent b37693f85d
commit 5aab6222f9
2 changed files with 2 additions and 1 deletions

View file

@ -48,6 +48,7 @@ async def feeds_compact_formatter(post_type, post, message_target, wiki, article
elif post_type == "ARTICLE_COMMENT": elif post_type == "ARTICLE_COMMENT":
if article_page is None: if article_page is None:
article_page = {"title": _("unknown"), "fullUrl": wiki} # No page known article_page = {"title": _("unknown"), "fullUrl": wiki} # No page known
article_page["fullUrl"] = article_page["fullUrl"].replace(")", "\)").replace("()", "\(")
if not post["isReply"]: if not post["isReply"]:
message = "🗒️ "+_("[{author}]({author_url}) created a [comment](<{url}?commentId={commentId}>) on [{article}](<{url}>)").format(author=author, author_url=author_url, url=article_page["fullUrl"], article=article_page["title"], commentId=post["threadId"]) message = "🗒️ "+_("[{author}]({author_url}) created a [comment](<{url}?commentId={commentId}>) on [{article}](<{url}>)").format(author=author, author_url=author_url, url=article_page["fullUrl"], article=article_page["title"], commentId=post["threadId"])
else: else:

View file

@ -232,5 +232,5 @@ async def essential_feeds(change: dict, comment_pages: dict, db_wiki: sqlite3.Ro
if identification_string == "ARTICLE_COMMENT" and comment_pages is not None: if identification_string == "ARTICLE_COMMENT" and comment_pages is not None:
comment_page = comment_pages.get(change["forumId"], None) comment_page = comment_pages.get(change["forumId"], None)
if comment_page is not None: if comment_page is not None:
comment_page["fullUrl"] = "/".join(db_wiki["wiki"].split("/", 3)[:3]) + comment_page["relativeUrl"].replace(")", "\)").replace("()", "\(") comment_page["fullUrl"] = "/".join(db_wiki["wiki"].split("/", 3)[:3]) + comment_page["relativeUrl"]
return await appearance_mode(identification_string, change, target, db_wiki["wiki"], article_page=comment_page) return await appearance_mode(identification_string, change, target, db_wiki["wiki"], article_page=comment_page)