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