diff --git a/webapp_post.py b/webapp_post.py index d1a376b5a..e06d14950 100644 --- a/webapp_post.py +++ b/webapp_post.py @@ -25,6 +25,7 @@ from posts import post_is_muted from posts import get_person_box from posts import download_announce from posts import populate_replies_json +from utils import remove_markup_tag from utils import ap_proxy_type from utils import remove_style_within_html from utils import license_link_from_name @@ -1955,6 +1956,18 @@ def _get_buy_footer(buy_links: {}, translate: {}) -> str: return buy_str +def _remove_incomplete_code_tags(content: str) -> str: + """Remove any uncompleted code tags + """ + tags = ('code', 'pre') + for tag_name in tags: + if '<' + tag_name not in content: + continue + if '' + \ object_content + ''