diff --git a/content.py b/content.py index a57e40724..fd2ab3168 100644 --- a/content.py +++ b/content.py @@ -1382,7 +1382,8 @@ def add_html_tags(base_dir: str, http_prefix: str, max_word_length = 40 replacements = { '\r': '', - '\n': ' --linebreak-- ' + '\n': ' --linebreak-- ', + '"': ' --quote-- ' } content = replace_strings(content, replacements) now_playing_str = 'NowPlaying' @@ -1521,6 +1522,7 @@ def add_html_tags(base_dir: str, http_prefix: str, if long_words_list: content = remove_long_words(content, max_word_length, long_words_list) content = limit_repeated_words(content, 6) + content = content.replace(' --quote-- ', '"') content = content.replace(' --linebreak-- ', '
') content = html_replace_email_quote(content) return '
' + html_replace_quote_marks(content) + '
' diff --git a/tests.py b/tests.py index 2e19ebfc9..cefb437c3 100644 --- a/tests.py +++ b/tests.py @@ -4123,6 +4123,22 @@ def _test_addemoji(base_dir: str): print('content_modified: ' + content_modified) assert content_modified == expected_content + content2 = '"This is a quote with a #hashtag".' + content_modified2 = \ + add_html_tags(base_dir, http_prefix, + nickname, domain, content2, + recipients, hashtags, translate, True) + expected_content2 = \ + '"This is a quote with a ' + \ + '' + \ + '' + \ + 'hashtag".
' + if content_modified2 != expected_content2: + print('expected_content2: ' + expected_content2) + print('content_modified2: ' + content_modified2) + assert content_modified2 == expected_content2 + profile_description = \ "Software engineer developing federated and decentralized " + \ "systems for a more habitable, resillient and human-scale " + \