Index: Source/core/editing/ReplaceSelectionCommand.cpp |
diff --git a/Source/core/editing/ReplaceSelectionCommand.cpp b/Source/core/editing/ReplaceSelectionCommand.cpp |
index 5b7939ef51b9433aab5a09051892b28cd4dab46e..50f5ae214cca5b966558e58671b1d15663254ae0 100644 |
--- a/Source/core/editing/ReplaceSelectionCommand.cpp |
+++ b/Source/core/editing/ReplaceSelectionCommand.cpp |
@@ -1125,7 +1125,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); |