Blame SOURCES/evolution-3.28.5-composer-extra-nl-url.patch

3930dc
diff -up evolution-3.28.5/src/e-util/test-html-editor-units-bugs.c.composer-extra-nl-url evolution-3.28.5/src/e-util/test-html-editor-units-bugs.c
3930dc
--- evolution-3.28.5/src/e-util/test-html-editor-units-bugs.c.composer-extra-nl-url	2018-11-09 13:34:49.430164229 +0100
3930dc
+++ evolution-3.28.5/src/e-util/test-html-editor-units-bugs.c	2018-11-09 13:34:49.432164229 +0100
3930dc
@@ -1319,6 +1319,44 @@ test_issue_86 (TestFixture *fixture)
3930dc
 	g_free (converted);
3930dc
 }
3930dc
 
3930dc
+static void
3930dc
+test_issue_103 (TestFixture *fixture)
3930dc
+{
3930dc
+	#define LONG_URL "https://www.example.com/123456789012345678901234567890123456789012345678901234567890"
3930dc
+	#define SHORTER_URL "https://www.example.com/1234567890123456789012345678901234567890"
3930dc
+	#define SHORT_URL "https://www.example.com/"
3930dc
+
3930dc
+	if (!test_utils_run_simple_test (fixture,
3930dc
+		"mode:plain\n"
3930dc
+		"type:before\\n"
3930dc
+		LONG_URL "\\n"
3930dc
+		"after\\n"
3930dc
+		"prefix text " SHORTER_URL " suffix\\n"
3930dc
+		"prefix " SHORT_URL " suffix\\n"
3930dc
+		"end\n",
3930dc
+		HTML_PREFIX "
before
"
3930dc
+		""
3930dc
+		"
after
"
3930dc
+		"
prefix text " SHORTER_URL " suffix
"
3930dc
+		"
prefix " SHORT_URL " suffix
"
3930dc
+		"
end
"
3930dc
+		HTML_SUFFIX,
3930dc
+		"before\n"
3930dc
+		LONG_URL "\n"
3930dc
+		"after\n"
3930dc
+		"prefix text \n"
3930dc
+		SHORTER_URL " suffix\n"
3930dc
+		"prefix " SHORT_URL " suffix\n"
3930dc
+		"end")) {
3930dc
+		g_test_fail ();
3930dc
+		return;
3930dc
+	}
3930dc
+
3930dc
+	#undef SHORT_URL
3930dc
+	#undef SHORTER_URL
3930dc
+	#undef LONG_URL
3930dc
+}
3930dc
+
3930dc
 void
3930dc
 test_add_html_editor_bug_tests (void)
3930dc
 {
3930dc
@@ -1349,4 +1387,5 @@ test_add_html_editor_bug_tests (void)
3930dc
 	test_utils_add_test ("/bug/788829", test_bug_788829);
3930dc
 	test_utils_add_test ("/bug/750636", test_bug_750636);
3930dc
 	test_utils_add_test ("/issue/86", test_issue_86);
3930dc
+	test_utils_add_test ("/issue/103", test_issue_103);
3930dc
 }
3930dc
diff -up evolution-3.28.5/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c.composer-extra-nl-url evolution-3.28.5/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c
3930dc
--- evolution-3.28.5/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c.composer-extra-nl-url	2018-11-09 13:34:49.431164229 +0100
3930dc
+++ evolution-3.28.5/src/modules/webkit-editor/web-extension/e-editor-dom-functions.c	2018-11-09 13:34:49.434164229 +0100
3930dc
@@ -14089,7 +14089,7 @@ wrap_lines (EEditorPage *editor_page,
3930dc
 
3930dc
 				next_sibling = webkit_dom_node_get_next_sibling (node);
3930dc
 				/* If the anchor doesn't fit on the line, add it to a separate line. */
3930dc
-				if ((line_length + anchor_length) > length_to_wrap) {
3930dc
+				if (line_length > 0 && (line_length + anchor_length) > length_to_wrap) {
3930dc
 					/* Put 
before the anchor, thus it starts on a new line */
3930dc
 					element = webkit_dom_document_create_element (document, "BR", NULL);
3930dc
 					element_add_class (element, "-x-evo-wrap-br");