Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael Istria2016-12-11 07:22:07 -0500
committerMickael Istria - away until January 11th2017-01-17 10:59:30 -0500
commitdfe9ea64ef2ccf3b1283625f05755abbdc3f934b (patch)
treec92b5cce87774209ccf81ee1cdd318148ae65c46 /org.eclipse.jface.text.tests
parentaa9773529d30c379ea5c0b25683e698ce2fb4574 (diff)
downloadeclipse.platform.text-dfe9ea64ef2ccf3b1283625f05755abbdc3f934b.tar.gz
eclipse.platform.text-dfe9ea64ef2ccf3b1283625f05755abbdc3f934b.tar.xz
eclipse.platform.text-dfe9ea64ef2ccf3b1283625f05755abbdc3f934b.zip
Bug 509032 - Support for em, strong, s, strike in HTML2TextRendererI20170117-2000
Change-Id: I1d09f85107a3137af081200803f5c08d50eecb01 Signed-off-by: Mickael Istria <mistria@redhat.com>
Diffstat (limited to 'org.eclipse.jface.text.tests')
-rw-r--r--org.eclipse.jface.text.tests/src/org/eclipse/jface/text/tests/HTML2TextReaderTest.java28
1 files changed, 27 insertions, 1 deletions
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 09e1c523b..678866305 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2015 IBM Corporation and others.
+ * Copyright (c) 2006, 2016 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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Mickael Istria (Red Hat Inc.) - [509032] Support additional tags
*******************************************************************************/
package org.eclipse.jface.text.tests;
@@ -275,5 +276,30 @@ public class HTML2TextReaderTest {
};
verify(string, expected, ranges);
}
+
+ @Test
+ public void testCombineBoldItalicStriker() throws IOException {
+ String string= "<strong>strong</strong>,<em>italic</em>,<s>strike</s>," +
+ "<strong><em>strongItalic</em></strong>,<s><strong>strongStrike</strong></s>," +
+ "<em><s>italicStrike</s></em>," +
+ "<em><strong><s>strongItalicStrike</s></strong></em>," +
+ "none";
+ String expected= "strong,italic,strike,strongItalic,strongStrike,italicStrike,strongItalicStrike,none";
+ StyleRange[] ranges= {
+ new StyleRange(0, 6, null, null, SWT.BOLD),
+ new StyleRange(7, 6, null, null, SWT.ITALIC),
+ strike(new StyleRange(14, 6, null, null)),
+ new StyleRange(21, 12, null, null, SWT.BOLD | SWT.ITALIC),
+ strike(new StyleRange(34, 12, null, null, SWT.BOLD)),
+ strike(new StyleRange(47, 12, null, null, SWT.ITALIC)),
+ strike(new StyleRange(60, 18, null, null, SWT.BOLD | SWT.ITALIC)),
+ };
+ verify(string, expected, ranges);
+ }
+
+ private StyleRange strike(StyleRange styleRange) {
+ styleRange.strikeout = true;
+ return styleRange;
+ }
}

Back to the top