Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2012-10-04 07:36:28 +0000
committerDani Megert2012-10-04 07:36:28 +0000
commit7edcbfb6389bbbdbc14c57d31e0be01640833275 (patch)
tree5ca524c3c96f31dc7d221eb1d3574bf48b80ab67
parent0caaade5037f0e98b612764d662d2ce729a96d4a (diff)
downloadeclipse.platform.text-7edcbfb6389bbbdbc14c57d31e0be01640833275.tar.gz
eclipse.platform.text-7edcbfb6389bbbdbc14c57d31e0be01640833275.tar.xz
eclipse.platform.text-7edcbfb6389bbbdbc14c57d31e0be01640833275.zip
Fixed bug 391072: HTML2TextReader.entity2Text(String) mangles all but 7v20121004-073628
escape codes
-rw-r--r--org.eclipse.jface.text.tests/META-INF/MANIFEST.MF2
-rw-r--r--org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/HTML2TextReaderTest.java12
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTML2TextReader.java4
3 files changed, 15 insertions, 3 deletions
diff --git a/org.eclipse.jface.text.tests/META-INF/MANIFEST.MF b/org.eclipse.jface.text.tests/META-INF/MANIFEST.MF
index 22d5fecc2..c0a150b7d 100644
--- a/org.eclipse.jface.text.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.jface.text.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Plugin.name
Bundle-SymbolicName: org.eclipse.jface.text.tests
-Bundle-Version: 3.8.0.qualifier
+Bundle-Version: 3.9.0.qualifier
Bundle-ClassPath: jfacetexttests.jar
Bundle-Vendor: %Plugin.providerName
Bundle-Localization: plugin
diff --git a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/HTML2TextReaderTest.java b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/HTML2TextReaderTest.java
index ab7163f02..1d85c8b32 100644
--- a/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/HTML2TextReaderTest.java
+++ b/org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/HTML2TextReaderTest.java
@@ -124,6 +124,18 @@ public class HTML2TextReaderTest extends TestCase {
verify(string, expected, 0);
}
+ public void testEntity1() throws IOException {
+ String string= "&";
+ String expected= "&";
+ verify(string, expected, 0);
+ }
+
+ public void testEntity2() throws IOException {
+ String string= "&unknown;";
+ String expected= "&unknown;";
+ verify(string, expected, 0);
+ }
+
public void testBug367378() throws IOException {
verify("<head>", "", 0);
verify("<head>some styles</html>", "", 0);
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTML2TextReader.java b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTML2TextReader.java
index a39126bba..24fd61672 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTML2TextReader.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/internal/text/html/HTML2TextReader.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2011 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -372,7 +372,7 @@ public class HTML2TextReader extends SubstitutionTextReader {
return str;
}
}
- return "&" + symbol; // not found //$NON-NLS-1$
+ return "&" + symbol + ";"; // not found //$NON-NLS-1$ //$NON-NLS-2$
}
/*

Back to the top