testEnterInBlockquoteRemovesExtraNodes() {
    setUpFields(true);

    // Let's assume we have the following DOM structure and the
    // cursor is placed after the first numbered list item "one".
    //
    // <blockquote class="tr_bq">
    //   <div><div>a</div><ol><li>one|</li></div>
    //   <div>two</div>
    // </blockquote>
    //
    // After pressing enter, we have the following structure.
    //
    // <blockquote class="tr_bq">
    //   <div><div>a</div><ol><li>one|</li></div>
    // </blockquote>
    // <div>&nbsp;</div>
    // <blockquote class="tr_bq">
    //   <div><ol><li><span id=""></span></li></ol></div>
    //   <div>two</div>
    // </blockquote>
    //
    // This appears to the user as an empty list. After the fix, the HTML
    // will be
    //
    // <blockquote class="tr_bq">
    //   <div><div>a</div><ol><li>one|</li></div>
    // </blockquote>
    // <div>&nbsp;</div>
    // <blockquote class="tr_bq">
    //   <div>two</div>
    // </blockquote>
    //
    field1.setSafeHtml(
        false,
        testing.newSafeHtmlForTest(
            '<blockquote class="tr_bq">' +
            '<div><div>a</div><ol><li id="cursor">one</li></div>' +
            '<div>b</div>' +
            '</blockquote>'));
    const dom = field1.getEditableDomHelper();
    Range.createCaret(dom.getElement('cursor').firstChild, 3).select();
    testingEvents.fireKeySequence(field1.getElement(), KeyCodes.ENTER);
    const elem = field1.getElement();
    let secondBlockquote =
        dom.getElementsByTagNameAndClass(TagName.BLOCKQUOTE, null, elem)[1];
    assertHTMLEquals('<div>b</div>', secondBlockquote.innerHTML);

    // Ensure that we remove only unnecessary subtrees.
    field1.setSafeHtml(
        false,
        testing.newSafeHtmlForTest(
            '<blockquote class="tr_bq">' +
            '<div><span>a</span><div id="cursor">one</div><div>two</div></div>' +
            '<div><span>c</span></div>' +
            '</blockquote>'));
    Range.createCaret(dom.getElement('cursor').firstChild, 3).select();
    testingEvents.fireKeySequence(field1.getElement(), KeyCodes.ENTER);
    secondBlockquote =
        dom.getElementsByTagNameAndClass(TagName.BLOCKQUOTE, null, elem)[1];
    const expectedHTML = '<div><div>two</div></div>' +
        '<div><span>c</span></div>';
    assertHTMLEquals(expectedHTML, secondBlockquote.innerHTML);

    // Place the cursor in the middle of a line.
    field1.setSafeHtml(
        false,
        testing.newSafeHtmlForTest(
            '<blockquote id="quote" class="tr_bq">' +
            '<div>one</div><div>two</div>' +
            '</blockquote>'));
    Range.createCaret(dom.getElement('quote').firstChild.firstChild, 1)
        .select();
    testingEvents.fireKeySequence(field1.getElement(), KeyCodes.ENTER);
    const blockquotes =
        dom.getElementsByTagNameAndClass(TagName.BLOCKQUOTE, null, elem);
    assertEquals(2, blockquotes.length);
    assertHTMLEquals('<div>o</div>', blockquotes[0].innerHTML);
    assertHTMLEquals('<div>ne</div><div>two</div>', blockquotes[1].innerHTML);
  }
Tests that pressing enter in a blockquote doesn't create unnecessary
DOM subtrees.
@bug 1991539
@bug 1991392