merge-requests/30/head
Bob Mottram 2024-03-19 21:03:09 +00:00
parent fdf39a8bcc
commit 803449f8b7
1 changed files with 3 additions and 7 deletions

View File

@ -1145,9 +1145,7 @@ def _load_auto_tags(base_dir: str, nickname: str, domain: str) -> []:
return [] return []
def _auto_tag(base_dir: str, nickname: str, domain: str, def _auto_tag(word_str: str, auto_tag_list: [], append_tags: []) -> None:
word_str: str, auto_tag_list: [],
append_tags: []):
"""Generates a list of tags to be automatically appended to the content """Generates a list of tags to be automatically appended to the content
""" """
for tag_rule in auto_tag_list: for tag_rule in auto_tag_list:
@ -1429,13 +1427,11 @@ def add_html_tags(base_dir: str, http_prefix: str,
original_domain, replace_emoji, hashtags, original_domain, replace_emoji, hashtags,
emoji_dict) emoji_dict)
else: else:
if _auto_tag(base_dir, nickname, domain, word_str, if _auto_tag(word_str, auto_tags_list, append_tags):
auto_tags_list, append_tags):
prev_word_str = '' prev_word_str = ''
continue continue
if prev_word_str: if prev_word_str:
if _auto_tag(base_dir, nickname, domain, if _auto_tag(prev_word_str + ' ' + word_str,
prev_word_str + ' ' + word_str,
auto_tags_list, append_tags): auto_tags_list, append_tags):
prev_word_str = '' prev_word_str = ''
continue continue