Redoing the input event should remove the BR if it was the only node there

WebKit is doing the same when we are writing.
This commit is contained in:
Tomas Popela
2016-08-23 10:00:03 +02:00
parent ca94746a39
commit 7134e8c167

View File

@ -853,6 +853,16 @@ undo_delete (EEditorPage *editor_page,
}
}
if (event->type == HISTORY_INPUT) {
WebKitDOMNode *sibling;
sibling = webkit_dom_node_get_next_sibling (WEBKIT_DOM_NODE (element));
if (sibling && WEBKIT_DOM_IS_HTML_BR_ELEMENT (sibling) &&
!webkit_dom_node_get_next_sibling (sibling)) {
remove_node (sibling);
}
}
remove_node (WEBKIT_DOM_NODE (element));
if (event->type == HISTORY_DELETE && !e_editor_page_get_html_mode (editor_page)) {