From 7f65a873400ed905f6c2a313a7db57e790419668 Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Fri, 25 Apr 2014 13:02:21 +0400 Subject: [PATCH] fix for Kubuntu/Firefox/Gmail (IDEA-67767) --- .../openapi/editor/richcopy/view/HtmlTransferableData.java | 7 ++++--- .../testData/editor/richcopy/BlockSelection.html | 4 ++-- .../testData/editor/richcopy/NormalSelection.html | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/openapi/editor/richcopy/view/HtmlTransferableData.java b/platform/lang-impl/src/com/intellij/openapi/editor/richcopy/view/HtmlTransferableData.java index e9780b732eec..7db4e418f569 100644 --- a/platform/lang-impl/src/com/intellij/openapi/editor/richcopy/view/HtmlTransferableData.java +++ b/platform/lang-impl/src/com/intellij/openapi/editor/richcopy/view/HtmlTransferableData.java @@ -32,7 +32,7 @@ import java.awt.datatransfer.DataFlavor; */ public class HtmlTransferableData extends AbstractSyntaxAwareReaderTransferableData implements MarkupHandler { - @NotNull public static final DataFlavor FLAVOR = new DataFlavor("text/html;class=java.io.Reader", "HTML text"); + @NotNull public static final DataFlavor FLAVOR = new DataFlavor("text/html; class=java.io.Reader; charset=UTF-8", "HTML text"); private StringBuilder myResultBuffer; private ColorRegistry myColorRegistry; @@ -64,7 +64,8 @@ public class HtmlTransferableData extends AbstractSyntaxAwareReaderTransferableD myMaxLength = maxLength; try { buildColorMap(); - myResultBuffer.append("
")
+                    .append("
");
+      myResultBuffer.append("
"); } finally { myResultBuffer = null; diff --git a/platform/platform-tests/testData/editor/richcopy/BlockSelection.html b/platform/platform-tests/testData/editor/richcopy/BlockSelection.html index 55a7dbc0558a..6d79208d30e3 100644 --- a/platform/platform-tests/testData/editor/richcopy/BlockSelection.html +++ b/platform/platform-tests/testData/editor/richcopy/BlockSelection.html @@ -1,3 +1,3 @@ -
 int field;
+
 int field;
 
- public static void main(String[] args) {
\ No newline at end of file + public static void main(String[] args) {
\ No newline at end of file diff --git a/platform/platform-tests/testData/editor/richcopy/NormalSelection.html b/platform/platform-tests/testData/editor/richcopy/NormalSelection.html index 8805dfd28b21..6c4f8dc96153 100644 --- a/platform/platform-tests/testData/editor/richcopy/NormalSelection.html +++ b/platform/platform-tests/testData/editor/richcopy/NormalSelection.html @@ -1,8 +1,8 @@ -
public class Basic {
+
public class Basic {
   int field;
 
   public static void main(String[] args) {
     System.out.println("Hello\tworld!");
   }
 }
-
\ No newline at end of file +
\ No newline at end of file