From f1289d486e9db5b6318aae41ba95256e7530f17b Mon Sep 17 00:00:00 2001 From: Her Email Date: Sun, 17 Dec 2023 22:48:29 -0500 Subject: [PATCH] fix edge cases for tags --- journal/models/mark.py | 2 +- takahe/utils.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/journal/models/mark.py b/journal/models/mark.py index 6c9fa1bd..8513754b 100644 --- a/journal/models/mark.py +++ b/journal/models/mark.py @@ -242,7 +242,7 @@ class Mark: post_as_new = shelf_type != last_shelf_type or visibility != last_visibility classic_repost = self.owner.user.preference.mastodon_repost_mode == 1 append = ( - f" \n@{self.owner.user.mastodon_acct}" + f"@{self.owner.user.mastodon_acct}\n" if visibility > 0 and share_to_mastodon and not classic_repost else "" ) diff --git a/takahe/utils.py b/takahe/utils.py index 4addfb45..8f5c550c 100644 --- a/takahe/utils.py +++ b/takahe/utils.py @@ -589,10 +589,10 @@ class Takahe: user = mark.owner.user tags = ( - "\n" - + user.preference.mastodon_append_tag.replace( + user.preference.mastodon_append_tag.replace( "[category]", str(ItemCategory(mark.item.category).label) ) + + "\n" if user.preference.mastodon_append_tag else "" ) @@ -603,7 +603,7 @@ class Takahe: f'{mark.action_label}《{mark.item.display_title}》' ) spoiler, txt = Takahe.get_spoiler_text(mark.comment_text, mark.item) - content = f"{stars} \n{txt}{tags}" + content = f"{stars} \n{txt}\n{tags}" data = { "object": { "tag": [mark.item.ap_object_ref],