diff --git a/kallithea/lib/helpers.py b/kallithea/lib/helpers.py --- a/kallithea/lib/helpers.py +++ b/kallithea/lib/helpers.py @@ -1302,6 +1302,7 @@ def urlify_text(s, repo_name=None, link_ if repo_name is not None: s = urlify_issues(s, repo_name, link_) s = MENTIONS_REGEX.sub(_mentions_replace, s) + s = s.replace('\r\n', '
').replace('\n', '
') return literal(s) diff --git a/kallithea/tests/functional/test_files.py b/kallithea/tests/functional/test_files.py --- a/kallithea/tests/functional/test_files.py +++ b/kallithea/tests/functional/test_files.py @@ -99,11 +99,11 @@ class TestFilesController(TestController revision='8911406ad776fdd3d0b9932a2e89677e57405a48', f_path='vcs/nodes.py')) - response.mustcontain("""
Partially implemented #16. filecontent/commit message/author/node name are safe_unicode now. -In addition some other __str__ are unicode as well -Added test for unicode -Improved test to clone into uniq repository. -removed extra unicode conversion in diff.
+ response.mustcontain("""
Partially implemented #16. filecontent/commit message/author/node name are safe_unicode now.
""" +"""In addition some other __str__ are unicode as well
""" +"""Added test for unicode
""" +"""Improved test to clone into uniq repository.
""" +"""removed extra unicode conversion in diff.
""") response.mustcontain("""""") diff --git a/kallithea/tests/models/test_dump_html_mails.ref.html b/kallithea/tests/models/test_dump_html_mails.ref.html --- a/kallithea/tests/models/test_dump_html_mails.ref.html +++ b/kallithea/tests/models/test_dump_html_mails.ref.html @@ -94,9 +94,7 @@ View Comment: http://comment.org -
This is the new comment. - - - and here it ends indented.
+
This is the new comment.

- and here it ends indented.
@@ -253,9 +251,7 @@ View Comment: http://comment.org -
This is the new comment. - - - and here it ends indented.
+
This is the new comment.

- and here it ends indented.
@@ -430,9 +426,7 @@ View Comment: http://comment.org -
This is the new comment. - - - and here it ends indented.
+
This is the new comment.

- and here it ends indented.
@@ -607,9 +601,7 @@ View Comment: http://comment.org -
This is the new comment. - - - and here it ends indented.
+
This is the new comment.

- and here it ends indented.
@@ -728,8 +720,7 @@ Subject: Test Message - +
This is the body of the test message - - nothing interesting here except indentation.
This is the body of the test message
- nothing interesting here except indentation.
@@ -986,8 +977,7 @@ View Pull Request: http://pr.org/7 -
This PR is awesome because it does stuff - - please approve indented!
+
This PR is awesome because it does stuff
- please approve indented!
@@ -1160,8 +1150,7 @@ View Pull Request: http://pr.org/7 -
This PR is awesome because it does stuff - - please approve indented!
+
This PR is awesome because it does stuff
- please approve indented!
@@ -1317,9 +1306,7 @@ View Comment: http://pr.org/comment -
Me too! - - - and indented on second line
+
Me too!

- and indented on second line
@@ -1482,9 +1469,7 @@ View Comment: http://pr.org/comment -
Me too! - - - and indented on second line
+
Me too!

- and indented on second line
@@ -1665,9 +1650,7 @@ View Comment: http://pr.org/comment -
Me too! - - - and indented on second line
+
Me too!

- and indented on second line
@@ -1848,9 +1831,7 @@ View Comment: http://pr.org/comment -
Me too! - - - and indented on second line
+
Me too!

- and indented on second line
@@ -2030,9 +2011,7 @@ View Comment: http://pr.org/comment -
Me too! - - - and indented on second line
+
Me too!

- and indented on second line
@@ -2212,9 +2191,7 @@ View Comment: http://pr.org/comment -
Me too! - - - and indented on second line
+
Me too!

- and indented on second line
@@ -2400,9 +2377,7 @@ View Comment: http://pr.org/comment -
Me too! - - - and indented on second line
+
Me too!

- and indented on second line
@@ -2588,9 +2563,7 @@ View Comment: http://pr.org/comment -
Me too! - - - and indented on second line
+
Me too!

- and indented on second line
diff --git a/kallithea/tests/other/test_libs.py b/kallithea/tests/other/test_libs.py --- a/kallithea/tests/other/test_libs.py +++ b/kallithea/tests/other/test_libs.py @@ -308,9 +308,9 @@ class TestLibs(TestController): some text 123123123123 sometimes ! """, - """Multi line\n""" - """ url[123123123123]\n""" - """ some text url[123123123123]\n""" + """Multi line
""" + """ url[123123123123]
""" + """ some text url[123123123123]
""" """ sometimes !"""), ]) def test_urlify_changesets(self, sample, expected): @@ -342,8 +342,8 @@ class TestLibs(TestController): ("""Multi line https://foo.bar.example.com some text lalala""", - """Multi line\n""" - """ url[https://foo.bar.example.com]\n""" + """Multi line
""" + """ url[https://foo.bar.example.com]
""" """ some text lalala""", "https://foo.bar.example.com"), ("@mention @someone",