[evolution/wip/mcrha/webkit-jsc-api] Add some tests for list (UL/LI) editing



commit 8723dbe0e7921fa73f6526ed90ac95017b8f9e2c
Author: Milan Crha <mcrha redhat com>
Date:   Wed Dec 4 12:19:39 2019 +0100

    Add some tests for list (UL/LI) editing

 data/webkit/e-convert.js            |   32 +-
 data/webkit/e-editor.js             |   27 +-
 src/e-util/test-html-editor-units.c | 2661 +++++++++++++++++++++++++++++++++--
 src/e-util/test-web-view-jsc.c      |   28 +-
 4 files changed, 2647 insertions(+), 101 deletions(-)
---
diff --git a/data/webkit/e-convert.js b/data/webkit/e-convert.js
index bf458f01c6..d5a39d32f1 100644
--- a/data/webkit/e-convert.js
+++ b/data/webkit/e-convert.js
@@ -210,6 +210,21 @@ EvoConvert.replaceList = function(element, tagName)
                                indent = EvoConvert.MIN_OL_WIDTH;
                }
 
+               if (list.hasAttribute("x-evo-extra-indent")) {
+                       var tmp = list.getAttribute("x-evo-extra-indent");
+
+                       if (tmp) {
+                               tmp = parseInt(tmp);
+
+                               if (!Number.isInteger(tmp))
+                                       tmp = 0;
+                       } else {
+                               tmp = 0;
+                       }
+
+                       indent += tmp;
+               }
+
                var liCount = 0;
 
                for (ii = 0; ii < list.children.length; ii++) {
@@ -274,6 +289,21 @@ EvoConvert.replaceList = function(element, tagName)
                                }
                        } else {
                                node = child.cloneNode(true);
+
+                               if (node.tagName == "UL" || node.tagName == "OL") {
+                                       var tmp = child.getAttribute("x-evo-extra-indent");
+
+                                       if (tmp) {
+                                               tmp = parseInt(tmp);
+
+                                               if (!Number.isInteger(tmp))
+                                                       tmp = 0;
+                                       } else {
+                                               tmp = 0;
+                                       }
+
+                                       node.setAttribute("x-evo-extra-indent", indent + tmp);
+                               }
                        }
 
                        list.parentNode.insertBefore(node, list);
@@ -631,7 +661,7 @@ EvoConvert.processNode = function(node, normalDivWidth)
                } else {
                        str = node.innerText;
 
-                       if (str != "\n" && style && style.display == "block") {
+                       if (str != "\n" && ((style && style.display == "block") || node.tagName == 
"ADDRESS")) {
                                str += "\n";
                        }
                }
diff --git a/data/webkit/e-editor.js b/data/webkit/e-editor.js
index 34cc1cf5d0..d207486ba1 100644
--- a/data/webkit/e-editor.js
+++ b/data/webkit/e-editor.js
@@ -173,6 +173,9 @@ EvoEditor.maybeUpdateFormattingState = function(force)
        }
 
        value = computedStyle ? computedStyle.fontFamily : "";
+       // dequote the font name, if needed
+       if (value.length > 1 && value.charAt(0) == '\"' && value.charAt(value.length - 1) == '\"')
+               value = value.substr(1, value.length - 2);
        if (force || value != EvoEditor.formattingState.fontFamily) {
                EvoEditor.formattingState.fontFamily = value;
                changes["fontFamily"] = (window.getComputedStyle(document.body).fontFamily == value) ? "" : 
value;
@@ -1103,6 +1106,13 @@ EvoEditor.splitList = function(element, nParents, onlyAffected)
 
        parent = from ? from.parentElement : element.parentElement;
 
+       if (!from && parent) {
+               from = parent.nextElementSibling;
+               nextFrom = from;
+               nParents--;
+               parent = parent.parentElement;
+       }
+
        while (nParents > 0 && parent && parent.tagName != "HTML") {
                nParents--;
                nextFrom = null;
@@ -1319,16 +1329,21 @@ EvoEditor.Indent = function(increment)
                                                        insBefore = EvoEditor.splitList(element, 1, affected);
 
                                                        clone = element.cloneNode(false);
-                                                       elemParent.insertBefore(clone, insBefore);
+                                                       if (insBefore)
+                                                               insBefore.parentElement.insertBefore(clone, 
insBefore);
+                                                       else
+                                                               elemParent.insertBefore(clone, insBefore);
 
                                                        for (jj = 0; jj < affected.length; jj++) {
                                                                clone.appendChild(affected[jj]);
                                                        }
                                                } else {
-                                                       if (!all && affected.length > 0 && !(affected[0] === 
element.firstElementChild)) {
+                                                       if (!all && affected.length > 0 && 
affected[affected.length - 1] === element.lastElementChild) {
+                                                               insBefore = element.nextElementSibling;
+                                                       } else if (!all && affected.length > 0 && 
!(affected[0] === element.firstElementChild)) {
                                                                insBefore = EvoEditor.splitList(element, 1, 
affected);
                                                        } else {
-                                                               insBefore = element.nextElementSibling;
+                                                               insBefore = element;
                                                        }
 
                                                        for (jj = 0; jj < affected.length; jj++) {
@@ -1336,12 +1351,16 @@ EvoEditor.Indent = function(increment)
                                                        }
                                                }
 
-                                               if (!element.childElementCount) {
+                                               while (element && !(element === elemParent) && 
!element.childElementCount) {
+                                                       tmpElement = element.parentElement;
+
                                                        this.selectionUpdater.beforeRemove(element);
 
                                                        element.parentElement.removeChild(element);
 
                                                        this.selectionUpdater.afterRemove(insBefore ? 
insBefore.previousElementSibling : elemParent.lastElementChild);
+
+                                                       element = tmpElement;
                                                }
 
                                                if (change)
diff --git a/src/e-util/test-html-editor-units.c b/src/e-util/test-html-editor-units.c
index 6839aa8d70..f4a55c93d5 100644
--- a/src/e-util/test-html-editor-units.c
+++ b/src/e-util/test-html-editor-units.c
@@ -617,6 +617,57 @@ test_list_alpha_plain (TestFixture *fixture)
                g_test_fail ();
 }
 
+static void
+test_list_number_html (TestFixture *fixture)
+{
+       if (!test_utils_run_simple_test (fixture,
+               "mode:html\n"
+               "action:style-list-number\n"
+               "type:item 1\\n\n"
+               "action:indent\n"
+               "type:item 2\\n\n"
+               "action:unindent\n"
+               "type:item 3\\n\n"
+               "type:\\n\n"
+               "type:text\n",
+               HTML_PREFIX
+                       "<ol>"
+                               "<li>item 1</li>"
+                               "<ol>"
+                                       "<li>item 2</li>"
+                               "</ol>"
+                               "<li>item 3</li>"
+                       "</ol>"
+                       "<div>text</div>"
+               HTML_SUFFIX,
+               "   1. item 1\n"
+               "         1. item 2\n"
+               "   2. item 3\n"
+               "text\n"))
+               g_test_fail ();
+}
+
+static void
+test_list_number_plain (TestFixture *fixture)
+{
+       if (!test_utils_run_simple_test (fixture,
+               "mode:plain\n"
+               "action:style-list-number\n"
+               "type:item 1\\n\n"
+               "action:indent\n"
+               "type:item 2\\n\n"
+               "action:unindent\n"
+               "type:item 3\\n\n"
+               "type:\\n\n"
+               "type:text\n",
+               NULL,
+               "   1. item 1\n"
+               "         1. item 2\n"
+               "   2. item 3\n"
+               "text\n"))
+               g_test_fail ();
+}
+
 static void
 test_list_roman_html (TestFixture *fixture)
 {
@@ -819,6 +870,2442 @@ test_list_multi_change_plain (TestFixture *fixture)
                g_test_fail ();
 }
 
+static void
+test_list_indent_same (TestFixture *fixture,
+                      gboolean is_html)
+{
+       const gchar *unindented_html, *unindented_plain;
+
+       unindented_html =
+               HTML_PREFIX
+                       "<ul>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+               HTML_SUFFIX;
+
+       unindented_plain =
+               " * a\n"
+               " * b\n"
+               " * c\n"
+               " * d\n";
+
+       if (!test_utils_run_simple_test (fixture,
+               "action:style-list-bullet\n"
+               "type:a\\n\n"
+               "type:b\\n\n"
+               "type:c\\n\n"
+               "type:d\\n\n"
+               "seq:nb\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing all items */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:uuuSddds\n"
+               "action:unindent\n"
+               "action:style-preformat\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>a</pre>"
+                       "<pre>b</pre>"
+                       "<pre>c</pre>"
+                       "<pre>d</pre>"
+               HTML_SUFFIX,
+               "a\n"
+               "b\n"
+               "c\n"
+               "d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:drop:1\n" /* 1 */
+               "action:indent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<ul>"
+                                       "<li>a</li>"
+                                       "<li>b</li>"
+                                       "<li>c</li>"
+                                       "<li>d</li>"
+                               "</ul>"
+                       "</ul>"
+               HTML_SUFFIX,
+               "    - a\n"
+               "    - b\n"
+               "    - c\n"
+               "    - d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:test:2\n"
+               "undo:undo\n"
+               "undo:test\n"
+               "undo:redo\n"
+               "undo:test:2\n"
+               "undo:drop:2\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing first item, single select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:uuu\n"
+               "action:unindent\n"
+               "action:style-preformat\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>a</pre>"
+                       "<ul>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+               HTML_SUFFIX,
+               "a\n"
+               " * b\n"
+               " * c\n"
+               " * d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:drop:1\n" /* 1 */
+               "action:indent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<ul><li>a</li></ul>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+               HTML_SUFFIX,
+               "    - a\n"
+               " * b\n"
+               " * c\n"
+               " * d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:test:2\n"
+               "undo:undo\n"
+               "undo:test\n"
+               "undo:redo\n"
+               "undo:test:2\n"
+               "undo:drop:2\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing mid item, single select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:d\n"
+               "action:unindent\n"
+               "action:style-preformat\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<li>a</li>"
+                       "</ul>"
+                       "<pre>b</pre>"
+                       "<ul>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+               HTML_SUFFIX,
+               " * a\n"
+               "b\n"
+               " * c\n"
+               " * d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:drop:1\n" /* 1 */
+               "action:indent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<li>a</li>"
+                               "<ul><li>b</li></ul>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+               HTML_SUFFIX,
+               " * a\n"
+               "    - b\n"
+               " * c\n"
+               " * d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:test:2\n"
+               "undo:undo\n"
+               "undo:test\n"
+               "undo:redo\n"
+               "undo:test:2\n"
+               "undo:drop:2\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing last item, single select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:dd\n"
+               "action:unindent\n"
+               "action:style-preformat\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                       "</ul>"
+                       "<pre>d</pre>"
+               HTML_SUFFIX,
+               " * a\n"
+               " * b\n"
+               " * c\n"
+               "d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:drop:1\n" /* 1 */
+               "action:indent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                               "<ul><li>d</li></ul>"
+                       "</ul>"
+               HTML_SUFFIX,
+               " * a\n"
+               " * b\n"
+               " * c\n"
+               "    - d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:test:2\n"
+               "undo:undo\n"
+               "undo:test\n"
+               "undo:redo\n"
+               "undo:test:2\n"
+               "undo:drop:2\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing first items, multi-select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:uuuSds\n"
+               "action:unindent\n"
+               "action:style-preformat\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>a</pre>"
+                       "<pre>b</pre>"
+                       "<ul>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+               HTML_SUFFIX,
+               "a\n"
+               "b\n"
+               " * c\n"
+               " * d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:drop:1\n" /* 1 */
+               "action:indent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<ul><li>a</li>"
+                               "<li>b</li></ul>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+               HTML_SUFFIX,
+               "    - a\n"
+               "    - b\n"
+               " * c\n"
+               " * d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:test:2\n"
+               "undo:undo\n"
+               "undo:test\n"
+               "undo:redo\n"
+               "undo:test:2\n"
+               "undo:drop:2\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing mid items, multi-select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:duSds\n"
+               "action:unindent\n"
+               "action:style-preformat\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<li>a</li>"
+                       "</ul>"
+                       "<pre>b</pre>"
+                       "<pre>c</pre>"
+                       "<ul>"
+                               "<li>d</li>"
+                       "</ul>"
+               HTML_SUFFIX,
+               " * a\n"
+               "b\n"
+               "c\n"
+               " * d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:drop:1\n" /* 1 */
+               "action:indent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<li>a</li>"
+                               "<ul><li>b</li>"
+                               "<li>c</li></ul>"
+                               "<li>d</li>"
+                       "</ul>"
+               HTML_SUFFIX,
+               " * a\n"
+               "    - b\n"
+               "    - c\n"
+               " * d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:test:2\n"
+               "undo:undo\n"
+               "undo:test\n"
+               "undo:redo\n"
+               "undo:test:2\n"
+               "undo:drop:2\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing last items, multi-select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:dSus\n"
+               "action:unindent\n"
+               "action:style-preformat\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                       "</ul>"
+                       "<pre>c</pre>"
+                       "<pre>d</pre>"
+               HTML_SUFFIX,
+               " * a\n"
+               " * b\n"
+               "c\n"
+               "d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:drop:1\n" /* 1 */
+               "action:indent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                               "<ul><li>c</li>"
+                               "<li>d</li></ul>"
+                       "</ul>"
+               HTML_SUFFIX,
+               " * a\n"
+               " * b\n"
+               "    - c\n"
+               "    - d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:test:2\n"
+               "undo:undo\n"
+               "undo:test\n"
+               "undo:redo\n"
+               "undo:test:2\n"
+               "undo:drop:2\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* The same tests as above, only with added text above and below the list */
+
+       unindented_html =
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ul>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX;
+
+       unindented_plain =
+               "prefix\n"
+               " * a\n"
+               " * b\n"
+               " * c\n"
+               " * d\n"
+               "suffix\n";
+
+       if (!test_utils_run_simple_test (fixture,
+               "action:select-all\n"
+               "seq:D\n"
+               "action:style-preformat\n"
+               "type:prefix\\n\n"
+               "action:style-list-bullet\n"
+               "type:a\\n\n"
+               "type:b\\n\n"
+               "type:c\\n\n"
+               "type:d\\n\n"
+               "seq:n\n"
+               "action:style-preformat\n"
+               "type:suffix\n"
+               "seq:u\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing all items */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:uuuSddds\n"
+               "action:unindent\n"
+               "action:style-preformat\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<pre>a</pre>"
+                       "<pre>b</pre>"
+                       "<pre>c</pre>"
+                       "<pre>d</pre>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               "a\n"
+               "b\n"
+               "c\n"
+               "d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:drop:1\n" /* 1 */
+               "action:indent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ul>"
+                               "<ul>"
+                                       "<li>a</li>"
+                                       "<li>b</li>"
+                                       "<li>c</li>"
+                                       "<li>d</li>"
+                               "</ul>"
+                       "</ul>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               "    - a\n"
+               "    - b\n"
+               "    - c\n"
+               "    - d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:test:2\n"
+               "undo:undo\n"
+               "undo:test\n"
+               "undo:redo\n"
+               "undo:test:2\n"
+               "undo:drop:2\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing first item, single select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:uuu\n"
+               "action:unindent\n"
+               "action:style-preformat\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<pre>a</pre>"
+                       "<ul>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               "a\n"
+               " * b\n"
+               " * c\n"
+               " * d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:drop:1\n" /* 1 */
+               "action:indent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ul>"
+                               "<ul><li>a</li></ul>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               "    - a\n"
+               " * b\n"
+               " * c\n"
+               " * d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:test:2\n"
+               "undo:undo\n"
+               "undo:test\n"
+               "undo:redo\n"
+               "undo:test:2\n"
+               "undo:drop:2\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing mid item, single select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:d\n"
+               "action:unindent\n"
+               "action:style-preformat\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ul>"
+                               "<li>a</li>"
+                       "</ul>"
+                       "<pre>b</pre>"
+                       "<ul>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               " * a\n"
+               "b\n"
+               " * c\n"
+               " * d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:drop:1\n" /* 1 */
+               "action:indent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ul>"
+                               "<li>a</li>"
+                               "<ul><li>b</li></ul>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               " * a\n"
+               "    - b\n"
+               " * c\n"
+               " * d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:test:2\n"
+               "undo:undo\n"
+               "undo:test\n"
+               "undo:redo\n"
+               "undo:test:2\n"
+               "undo:drop:2\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing last item, single select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:dd\n"
+               "action:unindent\n"
+               "action:style-preformat\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ul>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                       "</ul>"
+                       "<pre>d</pre>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               " * a\n"
+               " * b\n"
+               " * c\n"
+               "d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:drop:1\n" /* 1 */
+               "action:indent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ul>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                               "<ul><li>d</li></ul>"
+                       "</ul>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               " * a\n"
+               " * b\n"
+               " * c\n"
+               "    - d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:test:2\n"
+               "undo:undo\n"
+               "undo:test\n"
+               "undo:redo\n"
+               "undo:test:2\n"
+               "undo:drop:2\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing first items, multi-select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:uuuSds\n"
+               "action:unindent\n"
+               "action:style-preformat\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<pre>a</pre>"
+                       "<pre>b</pre>"
+                       "<ul>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               "a\n"
+               "b\n"
+               " * c\n"
+               " * d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:drop:1\n" /* 1 */
+               "action:indent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ul>"
+                               "<ul><li>a</li>"
+                               "<li>b</li></ul>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               "    - a\n"
+               "    - b\n"
+               " * c\n"
+               " * d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:test:2\n"
+               "undo:undo\n"
+               "undo:test\n"
+               "undo:redo\n"
+               "undo:test:2\n"
+               "undo:drop:2\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing mid items, multi-select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:duSds\n"
+               "action:unindent\n"
+               "action:style-preformat\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ul>"
+                               "<li>a</li>"
+                       "</ul>"
+                       "<pre>b</pre>"
+                       "<pre>c</pre>"
+                       "<ul>"
+                               "<li>d</li>"
+                       "</ul>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               " * a\n"
+               "b\n"
+               "c\n"
+               " * d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:drop:1\n" /* 1 */
+               "action:indent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ul>"
+                               "<li>a</li>"
+                               "<ul><li>b</li>"
+                               "<li>c</li></ul>"
+                               "<li>d</li>"
+                       "</ul>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               " * a\n"
+               "    - b\n"
+               "    - c\n"
+               " * d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:test:2\n"
+               "undo:undo\n"
+               "undo:test\n"
+               "undo:redo\n"
+               "undo:test:2\n"
+               "undo:drop:2\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing last items, multi-select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:dSus\n"
+               "action:unindent\n"
+               "action:style-preformat\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ul>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                       "</ul>"
+                       "<pre>c</pre>"
+                       "<pre>d</pre>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               " * a\n"
+               " * b\n"
+               "c\n"
+               "d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:drop:1\n" /* 1 */
+               "action:indent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ul>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                               "<ul><li>c</li>"
+                               "<li>d</li></ul>"
+                       "</ul>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               " * a\n"
+               " * b\n"
+               "    - c\n"
+               "    - d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:test:2\n"
+               "undo:undo\n"
+               "undo:test\n"
+               "undo:redo\n"
+               "undo:test:2\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+}
+
+static void
+test_list_indent_same_html (TestFixture *fixture)
+{
+       if (!test_utils_process_commands (fixture, "mode:html\n")) {
+               g_test_fail ();
+               return;
+       }
+
+       test_list_indent_same (fixture, TRUE);
+}
+
+static void
+test_list_indent_same_plain (TestFixture *fixture)
+{
+       if (!test_utils_process_commands (fixture, "mode:plain\n")) {
+               g_test_fail ();
+               return;
+       }
+
+       test_list_indent_same (fixture, FALSE);
+}
+
+static void
+test_list_indent_different (TestFixture *fixture,
+                           gboolean is_html)
+{
+       const gchar *unindented_html, *unindented_plain;
+
+       unindented_html =
+               HTML_PREFIX
+                       "<ul>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+               HTML_SUFFIX;
+
+       unindented_plain =
+               " * a\n"
+               " * b\n"
+               " * c\n"
+               " * d\n";
+
+       if (!test_utils_run_simple_test (fixture,
+               "action:style-list-bullet\n"
+               "type:a\\n\n"
+               "type:b\\n\n"
+               "type:c\\n\n"
+               "type:d\\n\n"
+               "seq:nb\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing first item, single select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:uuu\n"
+               "action:indent\n"
+               "action:style-list-number\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<ol><li>a</li></ol>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+               HTML_SUFFIX,
+               "      1. a\n"
+               " * b\n"
+               " * c\n"
+               " * d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ol><li>a</li></ol>"
+                       "<ul>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+               HTML_SUFFIX,
+               "   1. a\n"
+               " * b\n"
+               " * c\n"
+               " * d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 3 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "undo:drop:3\n"
+               "undo:undo:3\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing mid item, single select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:d\n"
+               "action:indent\n"
+               "action:style-list-alpha\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<li>a</li>"
+                               "<ol type=\"A\"><li>b</li></ol>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+               HTML_SUFFIX,
+               " * a\n"
+               "      A. b\n"
+               " * c\n"
+               " * d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<li>a</li>"
+                       "</ul>"
+                       "<ol type=\"A\"><li>b</li></ol>"
+                       "<ul>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+               HTML_SUFFIX,
+               " * a\n"
+               "   A. b\n"
+               " * c\n"
+               " * d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 3 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "undo:drop:3\n"
+               "undo:undo:3\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing last item, single select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:dd\n"
+               "action:indent\n"
+               "action:style-list-roman\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                               "<ol type=\"I\"><li>d</li></ol>"
+                       "</ul>"
+               HTML_SUFFIX,
+               " * a\n"
+               " * b\n"
+               " * c\n"
+               "      I. d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                       "</ul>"
+                       "<ol type=\"I\"><li>d</li></ol>"
+               HTML_SUFFIX,
+               " * a\n"
+               " * b\n"
+               " * c\n"
+               "   I. d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 3 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "undo:drop:3\n"
+               "undo:undo:3\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing first items, multi-select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:uuuSds\n"
+               "action:indent\n"
+               "action:style-list-number\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<ol>"
+                                       "<li>a</li>"
+                                       "<li>b</li>"
+                               "</ol>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+               HTML_SUFFIX,
+               "      1. a\n"
+               "      2. b\n"
+               " * c\n"
+               " * d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ol>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                       "</ol>"
+                       "<ul>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ul>"
+               HTML_SUFFIX,
+               "   1. a\n"
+               "   2. b\n"
+               " * c\n"
+               " * d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 3 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "undo:drop:3\n"
+               "undo:undo:3\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing mid items, multi-select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:duSds\n"
+               "action:indent\n"
+               "action:style-list-alpha\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<li>a</li>"
+                               "<ol type=\"A\">"
+                                       "<li>b</li>"
+                                       "<li>c</li>"
+                               "</ol>"
+                               "<li>d</li>"
+                       "</ul>"
+               HTML_SUFFIX,
+               " * a\n"
+               "      A. b\n"
+               "      B. c\n"
+               " * d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<li>a</li>"
+                       "</ul>"
+                       "<ol type=\"A\">"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                       "</ol>"
+                       "<ul>"
+                               "<li>d</li>"
+                       "</ul>"
+               HTML_SUFFIX,
+               " * a\n"
+               "   A. b\n"
+               "   B. c\n"
+               " * d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 3 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "undo:drop:3\n"
+               "undo:undo:3\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing last items, multi-select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:dSus\n"
+               "action:indent\n"
+               "action:style-list-roman\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                               "<ol type=\"I\">"
+                                       "<li>c</li>"
+                                       "<li>d</li>"
+                               "</ol>"
+                       "</ul>"
+               HTML_SUFFIX,
+               " * a\n"
+               " * b\n"
+               "      I. c\n"
+               "     II. d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<ul>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                       "</ul>"
+                       "<ol type=\"I\">"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ol>"
+               HTML_SUFFIX,
+               " * a\n"
+               " * b\n"
+               "   I. c\n"
+               "  II. d\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 3 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "undo:drop:3\n"
+               "undo:undo:3\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* The same tests as above, only with added text above and below the list */
+
+       unindented_html =
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ol>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ol>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX;
+
+       unindented_plain =
+               "prefix\n"
+               "   1. a\n"
+               "   2. b\n"
+               "   3. c\n"
+               "   4. d\n"
+               "suffix\n";
+
+       if (!test_utils_run_simple_test (fixture,
+               "action:select-all\n"
+               "seq:D\n"
+               "action:style-preformat\n"
+               "type:prefix\\n\n"
+               "action:style-list-number\n"
+               "type:a\\n\n"
+               "type:b\\n\n"
+               "type:c\\n\n"
+               "type:d\\n\n"
+               "seq:n\n"
+               "action:style-preformat\n"
+               "type:suffix\n"
+               "seq:ur\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing first item, single select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:uuu\n"
+               "action:indent\n"
+               "action:style-list-bullet\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ol>"
+                               "<ul><li>a</li></ul>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ol>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               "       - a\n"
+               "   1. b\n"
+               "   2. c\n"
+               "   3. d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ul><li>a</li></ul>"
+                       "<ol>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ol>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               " * a\n"
+               "   1. b\n"
+               "   2. c\n"
+               "   3. d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 3 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "undo:drop:3\n"
+               "undo:undo:3\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing mid item, single select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:d\n"
+               "action:indent\n"
+               "action:style-list-alpha\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ol>"
+                               "<li>a</li>"
+                               "<ol type=\"A\"><li>b</li></ol>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ol>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               "   1. a\n"
+               "         A. b\n"
+               "   2. c\n"
+               "   3. d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ol>"
+                               "<li>a</li>"
+                       "</ol>"
+                       "<ol type=\"A\"><li>b</li></ol>"
+                       "<ol>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ol>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               "   1. a\n"
+               "   A. b\n"
+               "   1. c\n"
+               "   2. d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 3 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "undo:drop:3\n"
+               "undo:undo:3\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing last item, single select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:dd\n"
+               "action:indent\n"
+               "action:style-list-roman\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ol>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                               "<ol type=\"I\"><li>d</li></ol>"
+                       "</ol>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               "   1. a\n"
+               "   2. b\n"
+               "   3. c\n"
+               "         I. d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ol>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                       "</ol>"
+                       "<ol type=\"I\"><li>d</li></ol>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               "   1. a\n"
+               "   2. b\n"
+               "   3. c\n"
+               "   I. d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 3 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "undo:drop:3\n"
+               "undo:undo:3\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing first items, multi-select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:uuuSds\n"
+               "action:indent\n"
+               "action:style-list-bullet\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ol>"
+                               "<ul>"
+                                       "<li>a</li>"
+                                       "<li>b</li>"
+                               "</ul>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ol>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               "       - a\n"
+               "       - b\n"
+               "   1. c\n"
+               "   2. d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ul>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                       "</ul>"
+                       "<ol>"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ol>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               " * a\n"
+               " * b\n"
+               "   1. c\n"
+               "   2. d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 3 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "undo:drop:3\n"
+               "undo:undo:3\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing mid items, multi-select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:duSds\n"
+               "action:indent\n"
+               "action:style-list-alpha\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ol>"
+                               "<li>a</li>"
+                               "<ol type=\"A\">"
+                                       "<li>b</li>"
+                                       "<li>c</li>"
+                               "</ol>"
+                               "<li>d</li>"
+                       "</ol>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               "   1. a\n"
+               "         A. b\n"
+               "         B. c\n"
+               "   2. d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ol>"
+                               "<li>a</li>"
+                       "</ol>"
+                       "<ol type=\"A\">"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                       "</ol>"
+                       "<ol>"
+                               "<li>d</li>"
+                       "</ol>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               "   1. a\n"
+               "   A. b\n"
+               "   B. c\n"
+               "   1. d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 3 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "undo:drop:3\n"
+               "undo:undo:3\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       /* Changing last items, multi-select */
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 1 */
+               "seq:dSus\n"
+               "action:indent\n"
+               "action:style-list-roman\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ol>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                               "<ol type=\"I\">"
+                                       "<li>c</li>"
+                                       "<li>d</li>"
+                               "</ol>"
+                       "</ol>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               "   1. a\n"
+               "   2. b\n"
+               "         I. c\n"
+               "        II. d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:2\n"
+               "undo:test:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>prefix</pre>"
+                       "<ol>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                       "</ol>"
+                       "<ol type=\"I\">"
+                               "<li>c</li>"
+                               "<li>d</li>"
+                       "</ol>"
+                       "<pre>suffix</pre>"
+               HTML_SUFFIX,
+               "prefix\n"
+               "   1. a\n"
+               "   2. b\n"
+               "   I. c\n"
+               "  II. d\n"
+               "suffix\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 3 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "undo:drop:3\n"
+               "undo:undo:3\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+}
+
+static void
+test_list_indent_different_html (TestFixture *fixture)
+{
+       if (!test_utils_process_commands (fixture, "mode:html\n")) {
+               g_test_fail ();
+               return;
+       }
+
+       test_list_indent_different (fixture, TRUE);
+}
+
+static void
+test_list_indent_different_plain (TestFixture *fixture)
+{
+       if (!test_utils_process_commands (fixture, "mode:plain\n")) {
+               g_test_fail ();
+               return;
+       }
+
+       test_list_indent_different (fixture, FALSE);
+}
+
+static void
+test_list_indent_multi (TestFixture *fixture,
+                       gboolean is_html)
+{
+       const gchar *unindented_html, *unindented_plain;
+
+       unindented_html =
+               HTML_PREFIX
+                       "<pre>line 1</pre>"
+                       "<pre>line 2</pre>"
+                       "<ul>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                       "</ul>"
+                       "<pre>line 3</pre>"
+                       "<ol>"
+                               "<li>1</li>"
+                               "<li>2</li>"
+                       "</ol>"
+                       "<pre>line 4</pre>"
+                       "<ol type=\"A\">"
+                               "<li>A</li>"
+                               "<li>B</li>"
+                       "</ol>"
+                       "<pre>line 5</pre>"
+                       "<ol type=\"I\">"
+                               "<li>i</li>"
+                               "<li>ii</li>"
+                       "</ol>"
+                       "<pre>line 6</pre>"
+               HTML_SUFFIX;
+
+       unindented_plain =
+               "line 1\n"
+               "line 2\n"
+               " * a\n"
+               " * b\n"
+               " * c\n"
+               "line 3\n"
+               "   1. 1\n"
+               "   2. 2\n"
+               "line 4\n"
+               "   A. A\n"
+               "   B. B\n"
+               "line 5\n"
+               "   I. i\n"
+               "  II. ii\n"
+               "line 6\n";
+
+       if (!test_utils_run_simple_test (fixture,
+               "action:style-preformat\n"
+               "type:line 1\\n\n"
+               "type:line 2\\n\n"
+               "action:style-list-bullet\n"
+               "type:a\\n\n"
+               "type:b\\n\n"
+               "type:c\\n\\n\n"
+               "action:style-preformat\n"
+               "type:line 3\\n\n"
+               "action:style-list-number\n"
+               "type:1\\n\n"
+               "type:2\\n\\n\n"
+               "action:style-preformat\n"
+               "type:line 4\\n\n"
+               "action:style-list-alpha\n"
+               "type:A\\n\n"
+               "type:B\\n\\n\n"
+               "action:style-preformat\n"
+               "type:line 5\\n\n"
+               "action:style-list-roman\n"
+               "type:i\\n\n"
+               "type:ii\\n\\n\n"
+               "action:style-preformat\n"
+               "type:line 6\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "action:select-all\n"
+               "undo:save\n" /* 1 */
+               "action:indent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre style=\"margin-left: 3ch;\">line 1</pre>"
+                       "<pre style=\"margin-left: 3ch;\">line 2</pre>"
+                       "<ul><ul>"
+                               "<li>a</li>"
+                               "<li>b</li>"
+                               "<li>c</li>"
+                       "</ul></ul>"
+                       "<pre style=\"margin-left: 3ch;\">line 3</pre>"
+                       "<ol><ol>"
+                               "<li>1</li>"
+                               "<li>2</li>"
+                       "</ol></ol>"
+                       "<pre style=\"margin-left: 3ch;\">line 4</pre>"
+                       "<ol type=\"A\"><ol type=\"A\">"
+                               "<li>A</li>"
+                               "<li>B</li>"
+                       "</ol></ol>"
+                       "<pre style=\"margin-left: 3ch;\">line 5</pre>"
+                       "<ol type=\"I\"><ol type=\"I\">"
+                               "<li>i</li>"
+                               "<li>ii</li>"
+                       "</ol></ol>"
+                       "<pre style=\"margin-left: 3ch;\">line 6</pre>"
+               HTML_SUFFIX,
+               "   line 1\n"
+               "   line 2\n"
+               "    - a\n"
+               "    - b\n"
+               "    - c\n"
+               "   line 3\n"
+               "         1. 1\n"
+               "         2. 2\n"
+               "   line 4\n"
+               "         A. A\n"
+               "         B. B\n"
+               "   line 5\n"
+               "         I. i\n"
+               "        II. ii\n"
+               "   line 6\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "action:unindent\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:undo\n"
+               "undo:test:1\n"
+               "undo:redo\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "seq:Shur\n" /* To be able to unindent the selection should end inside the list */
+               "action:unindent\n"
+               "action:style-preformat\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>line 1</pre>"
+                       "<pre>line 2</pre>"
+                       "<pre>a</pre>"
+                       "<pre>b</pre>"
+                       "<pre>c</pre>"
+                       "<pre>line 3</pre>"
+                       "<pre>1</pre>"
+                       "<pre>2</pre>"
+                       "<pre>line 4</pre>"
+                       "<pre>A</pre>"
+                       "<pre>B</pre>"
+                       "<pre>line 5</pre>"
+                       "<pre>i</pre>"
+                       "<pre>ii</pre>"
+                       "<pre>line 6</pre>"
+               HTML_SUFFIX,
+               "line 1\n"
+               "line 2\n"
+               "a\n"
+               "b\n"
+               "c\n"
+               "line 3\n"
+               "1\n"
+               "2\n"
+               "line 4\n"
+               "A\n"
+               "B\n"
+               "line 5\n"
+               "i\n"
+               "ii\n"
+               "line 6\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 3 */
+               "undo:undo:2\n"
+               "undo:redo:2\n"
+               "undo:test\n"
+               "undo:undo:2\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+}
+
+static void
+test_list_indent_multi_html (TestFixture *fixture)
+{
+       if (!test_utils_process_commands (fixture, "mode:html\n")) {
+               g_test_fail ();
+               return;
+       }
+
+       test_list_indent_multi (fixture, TRUE);
+}
+
+static void
+test_list_indent_multi_plain (TestFixture *fixture)
+{
+       if (!test_utils_process_commands (fixture, "mode:plain\n")) {
+               g_test_fail ();
+               return;
+       }
+
+       test_list_indent_multi (fixture, FALSE);
+}
+
+static void
+test_list_indent_nested (TestFixture *fixture,
+                        gboolean is_html)
+{
+       const gchar *unindented_html, *unindented_plain;
+
+       unindented_html =
+               HTML_PREFIX
+                       "<pre>line 1</pre>"
+                       "<ul>"
+                               "<li>a</li>"
+                               "<ol>"
+                                       "<li>123456789 123456789 123456789 123456789 123456789 123456789 
123456789 123456789</li>"
+                                       "<li>2</li>"
+                                               "<ul>"
+                                                       "<li>x</li>"
+                                                       "<li>y</li>"
+                                               "</ul>"
+                                       "<li>3</li>"
+                               "</ol>"
+                               "<li>b</li>"
+                       "</ul>"
+                       "<pre>line 2</pre>"
+                       "<ol>"
+                               "<li>1</li>"
+                                       "<ul>"
+                                               "<li>a</li>"
+                                               "<ol type=\"A\">"
+                                                       "<li>A</li>"
+                                                       "<li>B</li>"
+                                               "</ol>"
+                                               "<li>b</li>"
+                                       "</ul>"
+                               "<li>2</li>"
+                       "</ol>"
+                       "<pre>line 3</pre>"
+               HTML_SUFFIX;
+
+       unindented_plain =
+               "line 1\n"
+               " * a\n"
+               "      1. 123456789 123456789 123456789 123456789 123456789 123456789 123456789\n"
+               "         123456789\n"
+               "      2. 2\n"
+               "          + x\n"
+               "          + y\n"
+               "      3. 3\n"
+               " * b\n"
+               "line 2\n"
+               "   1. 1\n"
+               "       - a\n"
+               "            A. A\n"
+               "            B. B\n"
+               "       - b\n"
+               "   2. 2\n"
+               "line 3\n";
+
+       if (!test_utils_run_simple_test (fixture,
+               "action:style-preformat\n"
+               "type:line 1\\n\n"
+               "action:style-list-bullet\n"
+               "type:a\\n\n"
+               "action:indent\n"
+               "action:style-list-number\n"
+               "type:123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789\\n\n"
+               "type:2\\n\n"
+               "action:indent\n"
+               "action:style-list-bullet\n"
+               "type:x\\n\n"
+               "type:y\\n\\n\n"
+               "type:3\\n\\n\n"
+               "type:b\\n\\n\n"
+               "action:style-preformat\n"
+               "type:line 2\\n\n"
+               "action:style-list-number\n"
+               "type:1\\n\n"
+               "action:indent\n"
+               "action:style-list-bullet\n"
+               "type:a\\n\n"
+               "action:indent\n"
+               "action:style-list-alpha\n"
+               "type:A\\n\n"
+               "type:B\\n\\n\n"
+               "type:b\\n\\n\n"
+               "type:2\\n\\n\n"
+               "action:style-preformat\n"
+               "type:line 3\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "seq:hurSChcds\n" /* selects all but the "line 1" and "line 3" */
+               "undo:save\n" /* 1 */
+               "action:indent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>line 1</pre>"
+                       "<ul><ul>"
+                               "<li>a</li>"
+                               "<ol>"
+                                       "<li>123456789 123456789 123456789 123456789 123456789 123456789 
123456789 123456789</li>"
+                                       "<li>2</li>"
+                                               "<ul>"
+                                                       "<li>x</li>"
+                                                       "<li>y</li>"
+                                               "</ul>"
+                                       "<li>3</li>"
+                               "</ol>"
+                               "<li>b</li>"
+                       "</ul></ul>"
+                       "<pre style=\"margin-left: 3ch;\">line 2</pre>"
+                       "<ol><ol>"
+                               "<li>1</li>"
+                                       "<ul>"
+                                               "<li>a</li>"
+                                               "<ol type=\"A\">"
+                                                       "<li>A</li>"
+                                                       "<li>B</li>"
+                                               "</ol>"
+                                               "<li>b</li>"
+                                       "</ul>"
+                               "<li>2</li>"
+                       "</ol></ol>"
+                       "<pre>line 3</pre>"
+               HTML_SUFFIX,
+               "line 1\n"
+               "    - a\n"
+               "         1. 123456789 123456789 123456789 123456789 123456789 123456789 123456789\n"
+               "            123456789\n"
+               "         2. 2\n"
+               "             * x\n"
+               "             * y\n"
+               "         3. 3\n"
+               "    - b\n"
+               "   line 2\n"
+               "         1. 1\n"
+               "             + a\n"
+               "                  A. A\n"
+               "                  B. B\n"
+               "             + b\n"
+               "         2. 2\n"
+               "line 3\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "undo:drop:2\n" /* 0 */
+               "undo:save\n" /* 1 */
+               "action:unindent\n",
+               !is_html ? NULL : unindented_html, unindented_plain))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "undo:drop:2\n" /* 0 */
+               "undo:save\n" /* 1 */
+               "action:unindent\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>line 1</pre>"
+                       "<div>a</div>"
+                       "<ol>"
+                               "<li>123456789 123456789 123456789 123456789 123456789 123456789 123456789 
123456789</li>"
+                               "<li>2</li>"
+                                       "<ul>"
+                                               "<li>x</li>"
+                                               "<li>y</li>"
+                                       "</ul>"
+                               "<li>3</li>"
+                       "</ol>"
+                       "<div>b</div>"
+                       "<pre>line 2</pre>"
+                       "<div>1</div>"
+                               "<ul>"
+                                       "<li>a</li>"
+                                       "<ol type=\"A\">"
+                                               "<li>A</li>"
+                                               "<li>B</li>"
+                                       "</ol>"
+                                       "<li>b</li>"
+                               "</ul>"
+                       "<div>2</div>"
+                       "<pre>line 3</pre>"
+               HTML_SUFFIX,
+               "line 1\n"
+               "a\n"
+               "   1. 123456789 123456789 123456789 123456789 123456789 123456789 123456789\n"
+               "      123456789\n"
+               "   2. 2\n"
+               "       - x\n"
+               "       - y\n"
+               "   3. 3\n"
+               "b\n"
+               "line 2\n"
+               "1\n"
+               " * a\n"
+               "      A. A\n"
+               "      B. B\n"
+               " * b\n"
+               "2\n"
+               "line 3\n"))
+               g_test_fail ();
+
+       if (!test_utils_run_simple_test (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo\n"
+               "undo:test:2\n"
+               "undo:redo\n"
+               "undo:test\n"
+               "undo:drop:2\n" /* 0 */
+               "undo:save\n" /* 1 */
+               "seq:CecuueSChcdds\n"
+               "action:unindent\n"
+               "seq:CecuuueSChcddds\n"
+               "action:unindent\n"
+               "action:select-all\n"
+               "action:style-normal\n"
+               "action:style-preformat\n",
+               !is_html ? NULL :
+               HTML_PREFIX
+                       "<pre>line 1</pre>"
+                       "<pre>a</pre>"
+                       "<pre>123456789 123456789 123456789 123456789 123456789 123456789 123456789 
123456789</pre>"
+                       "<pre>2</pre>"
+                       "<pre>x</pre>"
+                       "<pre>y</pre>"
+                       "<pre>3</pre>"
+                       "<pre>b</pre>"
+                       "<pre>line 2</pre>"
+                       "<pre>1</pre>"
+                       "<pre>a</pre>"
+                       "<pre>A</pre>"
+                       "<pre>B</pre>"
+                       "<pre>b</pre>"
+                       "<pre>2</pre>"
+                       "<pre>line 3</pre>"
+               HTML_SUFFIX,
+               "line 1\n"
+               "a\n"
+               "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789\n"
+               "2\n"
+               "x\n"
+               "y\n"
+               "3\n"
+               "b\n"
+               "line 2\n"
+               "1\n"
+               "a\n"
+               "A\n"
+               "B\n"
+               "b\n"
+               "2\n"
+               "line 3\n"))
+               g_test_fail ();
+
+       if (!test_utils_process_commands (fixture,
+               "undo:save\n" /* 2 */
+               "undo:undo:4\n"
+               "undo:test:2\n"
+               "undo:redo:4\n"
+               "undo:test\n"))
+               g_test_fail ();
+}
+
+static void
+test_list_indent_nested_html (TestFixture *fixture)
+{
+       if (!test_utils_process_commands (fixture, "mode:html\n")) {
+               g_test_fail ();
+               return;
+       }
+
+       test_list_indent_nested (fixture, TRUE);
+}
+
+static void
+test_list_indent_nested_plain (TestFixture *fixture)
+{
+       if (!test_utils_process_commands (fixture, "mode:plain\n")) {
+               g_test_fail ();
+               return;
+       }
+
+       test_list_indent_nested (fixture, FALSE);
+}
+
 static void
 test_link_insert_dialog (TestFixture *fixture)
 {
@@ -2805,104 +5292,114 @@ main (gint argc,
        g_list_free_full (modules, (GDestroyNotify) g_type_module_unuse);
 
        test_utils_add_test ("/create/editor", test_create_editor);
-       test_utils_add_test ("/style/bold/selection", test_style_bold_selection);
-       test_utils_add_test ("/style/bold/typed", test_style_bold_typed);
-       test_utils_add_test ("/style/italic/selection", test_style_italic_selection);
-       test_utils_add_test ("/style/italic/typed", test_style_italic_typed);
-       test_utils_add_test ("/style/underline/selection", test_style_underline_selection);
-       test_utils_add_test ("/style/underline/typed", test_style_underline_typed);
-       test_utils_add_test ("/style/strikethrough/selection", test_style_strikethrough_selection);
-       test_utils_add_test ("/style/strikethrough/typed", test_style_strikethrough_typed);
-       test_utils_add_test ("/style/monospace/selection", test_style_monospace_selection);
-       test_utils_add_test ("/style/monospace/typed", test_style_monospace_typed);
+       test_utils_add_test ("/style/bold-selection", test_style_bold_selection);
+       test_utils_add_test ("/style/bold-typed", test_style_bold_typed);
+       test_utils_add_test ("/style/italic-selection", test_style_italic_selection);
+       test_utils_add_test ("/style/italic-typed", test_style_italic_typed);
+       test_utils_add_test ("/style/underline-selection", test_style_underline_selection);
+       test_utils_add_test ("/style/underline-typed", test_style_underline_typed);
+       test_utils_add_test ("/style/strikethrough-selection", test_style_strikethrough_selection);
+       test_utils_add_test ("/style/strikethrough-typed", test_style_strikethrough_typed);
+       test_utils_add_test ("/style/monospace-selection", test_style_monospace_selection);
+       test_utils_add_test ("/style/monospace-typed", test_style_monospace_typed);
        test_utils_add_test ("/justify/selection", test_justify_selection);
        test_utils_add_test ("/justify/typed", test_justify_typed);
        test_utils_add_test ("/indent/selection", test_indent_selection);
        test_utils_add_test ("/indent/typed", test_indent_typed);
-       test_utils_add_test ("/font/size/selection", test_font_size_selection);
-       test_utils_add_test ("/font/size/typed", test_font_size_typed);
-       test_utils_add_test ("/font/color/selection", test_font_color_selection);
-       test_utils_add_test ("/font/color/typed", test_font_color_typed);
-       test_utils_add_test ("/list/bullet/plain", test_list_bullet_plain);
-       test_utils_add_test ("/list/bullet/html", test_list_bullet_html);
-       test_utils_add_test ("/list/bullet/change", test_list_bullet_change);
-       test_utils_add_test ("/list/bullet/html/from-block", test_list_bullet_html_from_block);
-       test_utils_add_test ("/list/alpha/html", test_list_alpha_html);
-       test_utils_add_test ("/list/alpha/plain", test_list_alpha_plain);
-       test_utils_add_test ("/list/roman/html", test_list_roman_html);
-       test_utils_add_test ("/list/roman/plain", test_list_roman_plain);
-       test_utils_add_test ("/list/multi/html", test_list_multi_html);
-       test_utils_add_test ("/list/multi/plain", test_list_multi_plain);
-       test_utils_add_test ("/list/multi/change/html", test_list_multi_change_html);
-       test_utils_add_test ("/list/multi/change/plain", test_list_multi_change_plain);
-       test_utils_add_test ("/link/insert/dialog", test_link_insert_dialog);
-       test_utils_add_test ("/link/insert/dialog/selection", test_link_insert_dialog_selection);
-       test_utils_add_test ("/link/insert/dialog/remove-link", test_link_insert_dialog_remove_link);
-       test_utils_add_test ("/link/insert/typed", test_link_insert_typed);
-       test_utils_add_test ("/link/insert/typed/change-description", 
test_link_insert_typed_change_description);
-       test_utils_add_test ("/link/insert/typed/append", test_link_insert_typed_append);
-       test_utils_add_test ("/link/insert/typed/remove", test_link_insert_typed_remove);
+       test_utils_add_test ("/font/size-selection", test_font_size_selection);
+       test_utils_add_test ("/font/size-typed", test_font_size_typed);
+       test_utils_add_test ("/font/color-selection", test_font_color_selection);
+       test_utils_add_test ("/font/color-typed", test_font_color_typed);
+       test_utils_add_test ("/list/bullet-plain", test_list_bullet_plain);
+       test_utils_add_test ("/list/bullet-html", test_list_bullet_html);
+       test_utils_add_test ("/list/bullet-change", test_list_bullet_change);
+       test_utils_add_test ("/list/bullet-html-from-block", test_list_bullet_html_from_block);
+       test_utils_add_test ("/list/alpha-html", test_list_alpha_html);
+       test_utils_add_test ("/list/alpha-plain", test_list_alpha_plain);
+       test_utils_add_test ("/list/number-html", test_list_number_html);
+       test_utils_add_test ("/list/number-plain", test_list_number_plain);
+       test_utils_add_test ("/list/roman-html", test_list_roman_html);
+       test_utils_add_test ("/list/roman-plain", test_list_roman_plain);
+       test_utils_add_test ("/list/multi-html", test_list_multi_html);
+       test_utils_add_test ("/list/multi-plain", test_list_multi_plain);
+       test_utils_add_test ("/list/multi-change-html", test_list_multi_change_html);
+       test_utils_add_test ("/list/multi-change-plain", test_list_multi_change_plain);
+       test_utils_add_test ("/list/indent-same-html", test_list_indent_same_html);
+       test_utils_add_test ("/list/indent-same-plain", test_list_indent_same_plain);
+       test_utils_add_test ("/list/indent-different-html", test_list_indent_different_html);
+       test_utils_add_test ("/list/indent-different-plain", test_list_indent_different_plain);
+       test_utils_add_test ("/list/indent-multi-html", test_list_indent_multi_html);
+       test_utils_add_test ("/list/indent-multi-plain", test_list_indent_multi_plain);
+       test_utils_add_test ("/list/indent-nested-html", test_list_indent_nested_html);
+       test_utils_add_test ("/list/indent-nested-plain", test_list_indent_nested_plain);
+       test_utils_add_test ("/link/insert-dialog", test_link_insert_dialog);
+       test_utils_add_test ("/link/insert-dialog-selection", test_link_insert_dialog_selection);
+       test_utils_add_test ("/link/insert-dialog-remove-link", test_link_insert_dialog_remove_link);
+       test_utils_add_test ("/link/insert-typed", test_link_insert_typed);
+       test_utils_add_test ("/link/insert-typed-change-description", 
test_link_insert_typed_change_description);
+       test_utils_add_test ("/link/insert-typed-append", test_link_insert_typed_append);
+       test_utils_add_test ("/link/insert-typed-remove", test_link_insert_typed_remove);
        test_utils_add_test ("/h-rule/insert", test_h_rule_insert);
        test_utils_add_test ("/h-rule/insert-text-after", test_h_rule_insert_text_after);
        test_utils_add_test ("/image/insert", test_image_insert);
-       test_utils_add_test ("/emoticon/insert/typed", test_emoticon_insert_typed);
-       test_utils_add_test ("/emoticon/insert/typed-dash", test_emoticon_insert_typed_dash);
-       test_utils_add_test ("/paragraph/normal/selection", test_paragraph_normal_selection);
-       test_utils_add_test ("/paragraph/normal/typed", test_paragraph_normal_typed);
-       test_utils_add_test ("/paragraph/preformatted/selection", test_paragraph_preformatted_selection);
-       test_utils_add_test ("/paragraph/preformatted/typed", test_paragraph_preformatted_typed);
-       test_utils_add_test ("/paragraph/address/selection", test_paragraph_address_selection);
-       test_utils_add_test ("/paragraph/address/typed", test_paragraph_address_typed);
-       test_utils_add_test ("/paragraph/header1/selection", test_paragraph_header1_selection);
-       test_utils_add_test ("/paragraph/header1/typed", test_paragraph_header1_typed);
-       test_utils_add_test ("/paragraph/header2/selection", test_paragraph_header2_selection);
-       test_utils_add_test ("/paragraph/header2/typed", test_paragraph_header2_typed);
-       test_utils_add_test ("/paragraph/header3/selection", test_paragraph_header3_selection);
-       test_utils_add_test ("/paragraph/header3/typed", test_paragraph_header3_typed);
-       test_utils_add_test ("/paragraph/header4/selection", test_paragraph_header4_selection);
-       test_utils_add_test ("/paragraph/header4/typed", test_paragraph_header4_typed);
-       test_utils_add_test ("/paragraph/header5/selection", test_paragraph_header5_selection);
-       test_utils_add_test ("/paragraph/header5/typed", test_paragraph_header5_typed);
-       test_utils_add_test ("/paragraph/header6/selection", test_paragraph_header6_selection);
-       test_utils_add_test ("/paragraph/header6/typed", test_paragraph_header6_typed);
+       test_utils_add_test ("/emoticon/insert-typed", test_emoticon_insert_typed);
+       test_utils_add_test ("/emoticon/insert-typed-dash", test_emoticon_insert_typed_dash);
+       test_utils_add_test ("/paragraph/normal-selection", test_paragraph_normal_selection);
+       test_utils_add_test ("/paragraph/normal-typed", test_paragraph_normal_typed);
+       test_utils_add_test ("/paragraph/preformatted-selection", test_paragraph_preformatted_selection);
+       test_utils_add_test ("/paragraph/preformatted-typed", test_paragraph_preformatted_typed);
+       test_utils_add_test ("/paragraph/address-selection", test_paragraph_address_selection);
+       test_utils_add_test ("/paragraph/address-typed", test_paragraph_address_typed);
+       test_utils_add_test ("/paragraph/header1-selection", test_paragraph_header1_selection);
+       test_utils_add_test ("/paragraph/header1-typed", test_paragraph_header1_typed);
+       test_utils_add_test ("/paragraph/header2-selection", test_paragraph_header2_selection);
+       test_utils_add_test ("/paragraph/header2-typed", test_paragraph_header2_typed);
+       test_utils_add_test ("/paragraph/header3-selection", test_paragraph_header3_selection);
+       test_utils_add_test ("/paragraph/header3-typed", test_paragraph_header3_typed);
+       test_utils_add_test ("/paragraph/header4-selection", test_paragraph_header4_selection);
+       test_utils_add_test ("/paragraph/header4-typed", test_paragraph_header4_typed);
+       test_utils_add_test ("/paragraph/header5-selection", test_paragraph_header5_selection);
+       test_utils_add_test ("/paragraph/header5-typed", test_paragraph_header5_typed);
+       test_utils_add_test ("/paragraph/header6-selection", test_paragraph_header6_selection);
+       test_utils_add_test ("/paragraph/header6-typed", test_paragraph_header6_typed);
        test_utils_add_test ("/paragraph/wrap-lines", test_paragraph_wrap_lines);
-       test_utils_add_test ("/paste/singleline/html2html", test_paste_singleline_html2html);
-       test_utils_add_test ("/paste/singleline/html2plain", test_paste_singleline_html2plain);
-       test_utils_add_test ("/paste/singleline/plain2html", test_paste_singleline_plain2html);
-       test_utils_add_test ("/paste/singleline/plain2plain", test_paste_singleline_plain2plain);
-       test_utils_add_test ("/paste/multiline/html2html", test_paste_multiline_html2html);
-       test_utils_add_test ("/paste/multiline/html2plain", test_paste_multiline_html2plain);
-       test_utils_add_test ("/paste/multiline/div/html2html", test_paste_multiline_div_html2html);
-       test_utils_add_test ("/paste/multiline/div/html2plain", test_paste_multiline_div_html2plain);
-       test_utils_add_test ("/paste/multiline/p/html2html", test_paste_multiline_p_html2html);
-       test_utils_add_test ("/paste/multiline/p/html2plain", test_paste_multiline_p_html2plain);
-       test_utils_add_test ("/paste/multiline/plain2html", test_paste_multiline_plain2html);
-       test_utils_add_test ("/paste/multiline/plain2plain", test_paste_multiline_plain2plain);
-       test_utils_add_test ("/paste/quoted/singleline/html2html", test_paste_quoted_singleline_html2html);
-       test_utils_add_test ("/paste/quoted/singleline/html2plain", test_paste_quoted_singleline_html2plain);
-       test_utils_add_test ("/paste/quoted/singleline/plain2html", test_paste_quoted_singleline_plain2html);
-       test_utils_add_test ("/paste/quoted/singleline/plain2plain", 
test_paste_quoted_singleline_plain2plain);
-       test_utils_add_test ("/paste/quoted/multiline/html2html", test_paste_quoted_multiline_html2html);
-       test_utils_add_test ("/paste/quoted/multiline/html2plain", test_paste_quoted_multiline_html2plain);
-       test_utils_add_test ("/paste/quoted/multiline/plain2html", test_paste_quoted_multiline_plain2html);
-       test_utils_add_test ("/paste/quoted/multiline/plain2plain", test_paste_quoted_multiline_plain2plain);
+       test_utils_add_test ("/paste/singleline-html2html", test_paste_singleline_html2html);
+       test_utils_add_test ("/paste/singleline-html2plain", test_paste_singleline_html2plain);
+       test_utils_add_test ("/paste/singleline-plain2html", test_paste_singleline_plain2html);
+       test_utils_add_test ("/paste/singleline-plain2plain", test_paste_singleline_plain2plain);
+       test_utils_add_test ("/paste/multiline-html2html", test_paste_multiline_html2html);
+       test_utils_add_test ("/paste/multiline-html2plain", test_paste_multiline_html2plain);
+       test_utils_add_test ("/paste/multiline-div-html2html", test_paste_multiline_div_html2html);
+       test_utils_add_test ("/paste/multiline-div-html2plain", test_paste_multiline_div_html2plain);
+       test_utils_add_test ("/paste/multiline-p-html2html", test_paste_multiline_p_html2html);
+       test_utils_add_test ("/paste/multiline-p-html2plain", test_paste_multiline_p_html2plain);
+       test_utils_add_test ("/paste/multiline-plain2html", test_paste_multiline_plain2html);
+       test_utils_add_test ("/paste/multiline-plain2plain", test_paste_multiline_plain2plain);
+       test_utils_add_test ("/paste/quoted-singleline-html2html", test_paste_quoted_singleline_html2html);
+       test_utils_add_test ("/paste/quoted-singleline-html2plain", test_paste_quoted_singleline_html2plain);
+       test_utils_add_test ("/paste/quoted-singleline-plain2html", test_paste_quoted_singleline_plain2html);
+       test_utils_add_test ("/paste/quoted-singleline-plain2plain", 
test_paste_quoted_singleline_plain2plain);
+       test_utils_add_test ("/paste/quoted-multiline-html2html", test_paste_quoted_multiline_html2html);
+       test_utils_add_test ("/paste/quoted-multiline-html2plain", test_paste_quoted_multiline_html2plain);
+       test_utils_add_test ("/paste/quoted-multiline-plain2html", test_paste_quoted_multiline_plain2html);
+       test_utils_add_test ("/paste/quoted-multiline-plain2plain", test_paste_quoted_multiline_plain2plain);
        test_utils_add_test ("/cite/html2plain", test_cite_html2plain);
        test_utils_add_test ("/cite/shortline", test_cite_shortline);
        test_utils_add_test ("/cite/longline", test_cite_longline);
-       test_utils_add_test ("/cite/reply/html", test_cite_reply_html);
-       test_utils_add_test ("/cite/reply/plain", test_cite_reply_plain);
-       test_utils_add_test ("/undo/text/typed", test_undo_text_typed);
-       test_utils_add_test ("/undo/text/forward-delete", test_undo_text_forward_delete);
-       test_utils_add_test ("/undo/text/backward-delete", test_undo_text_backward_delete);
-       test_utils_add_test ("/undo/text/cut", test_undo_text_cut);
+       test_utils_add_test ("/cite/reply-html", test_cite_reply_html);
+       test_utils_add_test ("/cite/reply-plain", test_cite_reply_plain);
+       test_utils_add_test ("/undo/text-typed", test_undo_text_typed);
+       test_utils_add_test ("/undo/text-forward-delete", test_undo_text_forward_delete);
+       test_utils_add_test ("/undo/text-backward-delete", test_undo_text_backward_delete);
+       test_utils_add_test ("/undo/text-cut", test_undo_text_cut);
        test_utils_add_test ("/undo/style", test_undo_style);
        test_utils_add_test ("/undo/justify", test_undo_justify);
        test_utils_add_test ("/undo/indent", test_undo_indent);
-       test_utils_add_test ("/undo/link-paste/html", test_undo_link_paste_html);
-       test_utils_add_test ("/undo/link-paste/plain", test_undo_link_paste_plain);
+       test_utils_add_test ("/undo/link-paste-html", test_undo_link_paste_html);
+       test_utils_add_test ("/undo/link-paste-plain", test_undo_link_paste_plain);
        test_utils_add_test ("/delete/quoted", test_delete_quoted);
        test_utils_add_test ("/delete/after-quoted", test_delete_after_quoted);
-       test_utils_add_test ("/delete/quoted/selection", test_delete_quoted_selection);
+       test_utils_add_test ("/delete/quoted-selection", test_delete_quoted_selection);
        test_utils_add_test ("/replace/dialog", test_replace_dialog);
        test_utils_add_test ("/replace-all/dialog", test_replace_dialog_all);
 
diff --git a/src/e-util/test-web-view-jsc.c b/src/e-util/test-web-view-jsc.c
index 888ac846da..0e208c6da8 100644
--- a/src/e-util/test-web-view-jsc.c
+++ b/src/e-util/test-web-view-jsc.c
@@ -2488,20 +2488,20 @@ test_convert_to_plain (TestFixture *fixture)
                        "</ol>"),
                  "   1. 1\n"
                  "       - 1.-\n"
-                 "         i. 1.-.i\n"
-                 "               a. 1.-.i.a\n"
-                 "               b. 1.-.i.b\n"
-                 "        ii. 1.-.ii\n"
-                 "               A. 1.-.ii.A\n"
-                 "                   - 1.-.ii.A.-\n"
-                 "                      + 1.-.ii.A.-.+\n"
-                 "                     I. 1.-.ii.A.-.+.I\n"
-                 "                    II. 1.-.ii.A.-.+.II\n"
-                 "                   III. 1.-.ii.A.-.+.III\n"
-                 "                      + 1.-.ii.A.-.+\n"
-                 "                   - 1.-.ii.A.-\n"
-                 "               B. 1.-.ii.B\n"
-                 "       iii. 1.-.iii\n"
+                 "            i. 1.-.i\n"
+                 "                  a. 1.-.i.a\n"
+                 "                  b. 1.-.i.b\n"
+                 "           ii. 1.-.ii\n"
+                 "                  A. 1.-.ii.A\n"
+                 "                      - 1.-.ii.A.-\n"
+                 "                         + 1.-.ii.A.-.+\n"
+                 "                              I. 1.-.ii.A.-.+.I\n"
+                 "                             II. 1.-.ii.A.-.+.II\n"
+                 "                            III. 1.-.ii.A.-.+.III\n"
+                 "                         + 1.-.ii.A.-.+\n"
+                 "                      - 1.-.ii.A.-\n"
+                 "                  B. 1.-.ii.B\n"
+                 "          iii. 1.-.iii\n"
                  "       - 1.-\n"
                  "   2. 2\n",
                  -1 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]