mirror of https://gitlab.com/bashrc2/epicyon
Handle hashtags within quotes
parent
7d9556b8d4
commit
043927fce3
|
@ -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-- ', '</p><p>')
|
||||
content = html_replace_email_quote(content)
|
||||
return '<p>' + html_replace_quote_marks(content) + '</p>'
|
||||
|
|
16
tests.py
16
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 = \
|
||||
'<p>"This is a quote with a ' + \
|
||||
'<a href="http://testdomain.net/tags/hashtag" ' + \
|
||||
'class="mention hashtag" rel="tag" tabindex="10">' + \
|
||||
'<span aria-hidden="true">#</span>' + \
|
||||
'<span>hashtag</span></a>".</p>'
|
||||
if content_modified2 != expected_content2:
|
||||
print('expected_content2: ' + expected_content2)
|
||||
print('content_modified2: ' + content_modified2)
|
||||
assert content_modified2 == expected_content2
|
||||
|
||||
profile_description = \
|
||||
"<p>Software engineer developing federated and decentralized " + \
|
||||
"systems for a more habitable, resillient and human-scale " + \
|
||||
|
|
Loading…
Reference in New Issue