mirror of
https://github.com/caronc/apprise.git
synced 2024-11-25 01:24:03 +01:00
Escape new lines for TEXT->HTML conversions (#617)
This commit is contained in:
parent
1519e98cda
commit
e95484349e
@ -359,7 +359,7 @@ class URLBase(object):
|
||||
.replace(u' ', u' ')
|
||||
|
||||
if convert_new_lines:
|
||||
return escaped.replace(u'\n', u'<br/>')
|
||||
return escaped.replace(u'\n', u'<br/>')
|
||||
|
||||
return escaped
|
||||
|
||||
|
@ -70,7 +70,8 @@ def text_to_html(content):
|
||||
Converts specified content from plain text to HTML.
|
||||
"""
|
||||
|
||||
return URLBase.escape_html(content)
|
||||
# First eliminate any carriage returns
|
||||
return URLBase.escape_html(content, convert_new_lines=True)
|
||||
|
||||
|
||||
def html_to_text(content):
|
||||
|
@ -183,7 +183,7 @@ def test_notify_base():
|
||||
|
||||
assert NotifyBase.escape_html(
|
||||
"<content>'\t \n</content>", convert_new_lines=True) == \
|
||||
'<content>'  <br/></content>'
|
||||
'<content>'  <br/></content>'
|
||||
|
||||
# Test invalid data
|
||||
assert NotifyBase.split_path(None) == []
|
||||
|
Loading…
Reference in New Issue
Block a user