mirror of https://gitlab.com/bashrc2/epicyon
Remove any html from image descriptions
parent
1bc5f2515e
commit
7657fe5e43
|
@ -16,6 +16,7 @@ import webbrowser
|
|||
import urllib.parse
|
||||
from pathlib import Path
|
||||
from random import randint
|
||||
from utils import remove_html
|
||||
from utils import safe_system_string
|
||||
from utils import text_in_file
|
||||
from utils import disallow_announce
|
||||
|
@ -25,7 +26,6 @@ from utils import has_object_dict
|
|||
from utils import get_full_domain
|
||||
from utils import is_dm
|
||||
from utils import load_translations_from_file
|
||||
from utils import remove_html
|
||||
from utils import get_nickname_from_actor
|
||||
from utils import get_domain_from_actor
|
||||
from utils import is_pgp_encrypted
|
||||
|
@ -682,6 +682,7 @@ def _get_image_description(post_json_object: {}) -> str:
|
|||
message_str = img['name']
|
||||
if message_str:
|
||||
message_str = message_str.strip()
|
||||
message_str = remove_html(message_str)
|
||||
if not message_str.endswith('.'):
|
||||
image_description += message_str + '. '
|
||||
else:
|
||||
|
|
|
@ -72,6 +72,7 @@ from tests import test_update_actor
|
|||
from tests import run_all_tests
|
||||
from auth import store_basic_credentials
|
||||
from auth import create_password
|
||||
from utils import remove_html
|
||||
from utils import remove_eol
|
||||
from utils import text_in_file
|
||||
from utils import remove_domain_port
|
||||
|
@ -1665,7 +1666,7 @@ def _command_options() -> None:
|
|||
cc_url = None
|
||||
send_message = argb.message
|
||||
# client_to_server = argb.client
|
||||
attached_image_description = argb.imageDescription
|
||||
attached_image_description = remove_html(argb.imageDescription)
|
||||
city = 'London, England'
|
||||
send_threads = []
|
||||
post_log = []
|
||||
|
|
|
@ -473,7 +473,7 @@ def _post_to_speaker_json(base_dir: str, http_prefix: str,
|
|||
if img.get('name'):
|
||||
if isinstance(img['name'], str):
|
||||
image_description += \
|
||||
img['name'] + '. '
|
||||
remove_html(img['name']) + '. '
|
||||
|
||||
is_direct = is_dm(post_json_object)
|
||||
actor = local_actor_url(http_prefix, nickname, domain_full)
|
||||
|
|
|
@ -1238,6 +1238,7 @@ def get_post_attachments_as_html(base_dir: str,
|
|||
image_description = ''
|
||||
if attach.get('name'):
|
||||
image_description = attach['name'].replace('"', "'")
|
||||
image_description = remove_html(image_description)
|
||||
if _is_image_mime_type(media_type):
|
||||
image_url = attach['url']
|
||||
|
||||
|
|
Loading…
Reference in New Issue