From b15f9d079d61baf2342a2fe166937a89eb1c07e1 Mon Sep 17 00:00:00 2001 From: Jorg K Date: Tue, 10 Jan 2017 01:50:00 -0500 Subject: [PATCH] Bug 1328093 - HTMLEditor::InsertTextWithQuotations() should include the first line break into the it creates. r=masayuki --HG-- extra : rebase_source : 700f9369f435ba14fe7a5879b0e01bcb599a60d9 --- editor/libeditor/HTMLEditorDataTransfer.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/editor/libeditor/HTMLEditorDataTransfer.cpp b/editor/libeditor/HTMLEditorDataTransfer.cpp index b4d492bd96a2..c8cfbbb3e30d 100644 --- a/editor/libeditor/HTMLEditorDataTransfer.cpp +++ b/editor/libeditor/HTMLEditorDataTransfer.cpp @@ -1775,6 +1775,13 @@ HTMLEditor::InsertTextWithQuotations(const nsAString& aStringToInsert) // the quoted block. if (curHunkIsQuoted) { lineStart = firstNewline; + + // 'firstNewline' points to the first '\n'. We want to + // ensure that this first newline goes into the hunk + // since quoted hunks can be displayed as blocks + // (and the newline should become invisible in this case). + // So the next line needs to start at the next character. + lineStart++; } }