Index: Source/core/editing/ReplaceSelectionCommand.cpp |
diff --git a/Source/core/editing/ReplaceSelectionCommand.cpp b/Source/core/editing/ReplaceSelectionCommand.cpp |
index 81eb6ee8b5b678bd2766dd34e3ee2eec7df4aa81..90ce127d8175518ea113edf0d4ef5e271a199cf5 100644 |
--- a/Source/core/editing/ReplaceSelectionCommand.cpp |
+++ b/Source/core/editing/ReplaceSelectionCommand.cpp |
@@ -1124,7 +1124,7 @@ void ReplaceSelectionCommand::doApply() |
if (insertionBlock && insertionPos.deprecatedNode() == insertionBlock->parentNode() && (unsigned)insertionPos.deprecatedEditingOffset() < insertionBlock->nodeIndex() && !isStartOfParagraph(startOfInsertedContent)) |
insertNodeAt(createBreakElement(document()).get(), startOfInsertedContent.deepEquivalent()); |
- if (endBR && (plainTextFragment || shouldRemoveEndBR(endBR, originalVisPosBeforeEndBR))) { |
+ if (endBR && (plainTextFragment || (shouldRemoveEndBR(endBR, originalVisPosBeforeEndBR) && !(fragment.hasInterchangeNewlineAtEnd() && selectionIsPlainText)))) { |
RefPtr<Node> parent = endBR->parentNode(); |
insertedNodes.willRemoveNode(*endBR); |
removeNode(endBR); |