main
Bob Mottram 2024-03-20 13:04:25 +00:00
parent 803449f8b7
commit 4213d60b22
1 changed files with 57 additions and 59 deletions

View File

@ -1333,8 +1333,7 @@ def add_html_tags(base_dir: str, http_prefix: str,
# remove . for words which are not mentions
new_words = []
for word_index in range(0, len(words)):
word_str = words[word_index]
for _, word_str in enumerate(words):
if word_str.endswith('.'):
if not word_str.startswith('@'):
word_str = word_str[:-1]
@ -1377,7 +1376,8 @@ def add_html_tags(base_dir: str, http_prefix: str,
append_tags = []
for word_str in words:
word_len = len(word_str)
if word_len > 2:
if word_len <= 2:
continue
if word_len > max_word_length:
long_words_list.append(word_str)
first_char = word_str[0]
@ -1401,7 +1401,6 @@ def add_html_tags(base_dir: str, http_prefix: str,
continue
elif ':' in word_str:
word_str2 = word_str.split(':')[1]
# print('TAG: emoji located - ' + word_str)
if not emoji_dict:
# emoji.json is generated so that it can be customized and
# the changes will be retained even if default_emoji.json
@ -1422,7 +1421,6 @@ def add_html_tags(base_dir: str, http_prefix: str,
if not emoji_dict.get(ename):
emoji_dict[ename] = eitem
# print('TAG: looking up emoji for :' + word_str2 + ':')
_add_emoji(base_dir, ':' + word_str2 + ':', http_prefix,
original_domain, replace_emoji, hashtags,
emoji_dict)