Remove SHOW MORE when opening cw

main
Bob Mottram 2024-08-15 11:20:08 +01:00
parent b4290f5f1a
commit 8f896200d5
2 changed files with 5 additions and 3 deletions

View File

@ -457,7 +457,8 @@ def html_new_post(edit_post_params: {},
bold_reading, dogwhistles, bold_reading, dogwhistles,
minimize_all_images, None, minimize_all_images, None,
buy_sites, auto_cw_cache) buy_sites, auto_cw_cache)
new_post_text += open_content_warning(replied_to_post) new_post_text += \
open_content_warning(replied_to_post, translate)
# about the author # about the author
if has_object_dict(post_json_object): if has_object_dict(post_json_object):
if post_json_object['object'].get('attributedTo'): if post_json_object['object'].get('attributedTo'):

View File

@ -285,10 +285,11 @@ def get_content_warning_button(post_id: str, translate: {},
'</div></details>\n' '</div></details>\n'
def open_content_warning(text: str) -> str: def open_content_warning(text: str, translate: {}) -> str:
"""Opens content warning when replying to a post with a cw """Opens content warning when replying to a post with a cw
""" """
return text.replace('<details>', '<div>').replace('</details>', '</div>') text = text.replace('<details>', '').replace('</details>', '')
return text.replace(translate['SHOW MORE'], '', 1)
def _set_actor_property_url(actor_json: {}, def _set_actor_property_url(actor_json: {},