Author: Alex.Kolonitsky
Date: 2009-03-28 12:22:49 -0400 (Sat, 28 Mar 2009)
New Revision: 13275
Added:
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamSAXParser.java
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/Tag.java
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/TagFactory.java
Removed:
trunk/ui/editor/src/main/antlr/
Modified:
trunk/ui/editor/pom.xml
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/DefaultSeamTextConverter.java
trunk/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java
Log:
sax parser for transformation html to seam text
https://jira.jboss.org/jira/browse/RF-5825
Modified: trunk/ui/editor/pom.xml
===================================================================
--- trunk/ui/editor/pom.xml 2009-03-28 00:31:19 UTC (rev 13274)
+++ trunk/ui/editor/pom.xml 2009-03-28 16:22:49 UTC (rev 13275)
@@ -39,24 +39,6 @@
</library>
</configuration>
</plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>antlr-maven-plugin</artifactId>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <goals>
- <goal>generate</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <grammars>html-seamtext.g</grammars>
- </configuration>
- </plugin>
-
-
</plugins>
</build>
<profiles>
Modified:
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/DefaultSeamTextConverter.java
===================================================================
---
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/DefaultSeamTextConverter.java 2009-03-28
00:31:19 UTC (rev 13274)
+++
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/DefaultSeamTextConverter.java 2009-03-28
16:22:49 UTC (rev 13275)
@@ -38,8 +38,6 @@
import org.jboss.seam.text.SeamTextLexer;
import org.jboss.seam.text.SeamTextParser;
-import org.richfaces.antlr.HtmlSeamTextLexer;
-import org.richfaces.antlr.HtmlSeamTextParser;
/**
* Seam Text Converter class. Provides converting html to seam text and vice versa.
@@ -61,14 +59,12 @@
}
try {
- Reader r = new StringReader(value);
- HtmlSeamTextLexer lexer = new HtmlSeamTextLexer(r);
- HtmlSeamTextParser parser = new HtmlSeamTextParser(lexer);
- parser.startRule();
- return parser.toString();
+ return HtmlToSeamSAXParser.convertHtmlToSeamText(value);
} catch (Exception e) {
- FacesMessage message = new FacesMessage("An error occurred during conversion html
to seam text",e.getMessage());
+ FacesMessage message = new FacesMessage(
+ "An error occurred during conversion html to seam text",
e.getMessage());
+
throw new ConverterException(message,e);
}
Added:
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamSAXParser.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamSAXParser.java
(rev 0)
+++
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamSAXParser.java 2009-03-28
16:22:49 UTC (rev 13275)
@@ -0,0 +1,227 @@
+package org.richfaces.convert.seamtext;
+
+import antlr.SemanticException;
+import antlr.Token;
+import com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser;
+import com.sun.org.apache.xerces.internal.parsers.SAXParser;
+import org.jboss.seam.text.SeamTextParser;
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Stack;
+
+
+/**
+ * @user: akolonitsky
+ * Date: Mar 24, 2009
+ */
+public class HtmlToSeamSAXParser extends DefaultHandler {
+ private static final TagFactory TAG_FACTORY = new TagFactory();
+
+ public static final String ROOT_TAG_NAME = "root";
+ public static final Tag ROOT_TAG = TAG_FACTORY.getInstance(ROOT_TAG_NAME);
+
+ private SeamTextParser.Sanitizer sanitizer = new SeamTextParser.DefaultSanitizer();
+ private HtmlToSeamTransformer transformer;
+
+ private Stack<Tag> tagStack;
+
+ public HtmlToSeamSAXParser() {
+ tagStack = new Stack<Tag>();
+
+ transformer = new HtmlToSeamTransformer();
+ transformer.setHtmlElementStack(tagStack);
+ }
+
+ public static String convertHtmlToSeamText(final String html) throws IOException,
SAXException {
+ final HtmlToSeamSAXParser t = new HtmlToSeamSAXParser();
+ final AbstractSAXParser p = new SAXParser();
+ p.setContentHandler(t);
+ try {
+
p.setFeature("http://xml.org/sax/features/namespaces", false);
+
p.setFeature("http://xml.org/sax/features/namespace-prefixes",
false);
+ } catch (SAXException e) {
+ e.printStackTrace(); // TODO
+ }
+ final StringBuilder str = new StringBuilder(html.length() +
2*ROOT_TAG_NAME.length() + 5);
+
str.append('<').append(ROOT_TAG_NAME).append('>').append(html).append("</").append(ROOT_TAG_NAME).append('>');
+
+ p.parse(new InputSource(new StringReader(str.toString())));
+
+ return t.getTransformer().toString();
+ }
+
+ @Override
+ public void startElement(String uri, String localName, String qName, Attributes
attributes) {
+ if (!tagStack.isEmpty()){
+ tagStack.peek().setNotEmpty();
+ }
+
+ if (ROOT_TAG_NAME.equalsIgnoreCase(qName)) {
+ tagStack.push(ROOT_TAG);
+ } else if (hasInvalidParentTag()) {
+ if (!isValidTag(qName)) {
+ tagStack.push(TAG_FACTORY.getInstance(qName, processAttr(qName,
attributes)));
+ }
+
+ } else {
+ final Tag tag = TAG_FACTORY.getInstance(qName, processAttr(qName,
attributes)); // process attr invoked when it is invalid tag? is is can be optimized
+ if (isValidTag(tag)) {
+ transformer.openTag(tag);
+ } else {
+ setFirstInvalidTag(tag);
+ }
+
+ tagStack.push(tag); // 'push' must be after transformer.openTag(tag);
+ }
+ }
+
+ private Map<String, String> processAttr(final String tag, Attributes
attributes) {
+ final Map<String, String> map = new HashMap<String,
String>(attributes.getLength());
+ for (int i = 0; i < attributes.getLength(); i++) {
+ if (isValidAttr(tag, attributes.getQName(i))) {
+ map.put(attributes.getQName(i), attributes.getValue(i));
+ }
+ }
+
+ return map;
+ }
+
+ @Override
+ public void endElement(String uri, String localName, String qName) {
+ final Tag tag;
+
+ if (ROOT_TAG_NAME.equalsIgnoreCase(qName)) {
+ tag = tagStack.pop();
+ if (!ROOT_TAG_NAME.equalsIgnoreCase(tag.getName())) {
+ throw new IllegalStateException("Last tag must be '"+
ROOT_TAG_NAME +"', you have " + qName);
+ }
+ } else if (hasInvalidParentTag()) {
+ if (!isValidTag(qName)) {
+ tag = tagStack.pop();
+ if (tag == getFirstInvalidTag()) { // it is must be same tag(object)
+ cleanInvalidTag();
+ }
+ }
+
+ } else {
+ tag = tagStack.pop();
+
+ if (isValidTag(tag.getName())) {
+ transformer.closeTagWithBody(tag);
+ } else {
+ throw new IllegalStateException("Sometning wrong! You can't have
invalid tag at here!");
+ }
+ }
+ }
+
+ @Override
+ public void ignorableWhitespace(char[] ch, int start, int length) {
+ while (start < length) {
+ switch (ch[start]) {
+ case ' ': case '\t':
+ transformer.space(ch, start, length);
+ break;
+
+ case '\r': case '\n':
+ transformer.newline(ch, start, length);
+ break;
+
+ default:
+ throw new IllegalStateException("Unknow char : '" +
ch[start] + '\'');
+ }
+ start++;
+ }
+ }
+
+ @Override
+ public void characters(char[] ch, int start, int length) {
+ if (!tagStack.isEmpty()){
+ tagStack.peek().setNotEmpty();
+ }
+
+ transformer.text(ch, start, length);
+ }
+
+ /*
+ * Vlidation by sanitizer
+ * */
+ private static final class FakeToken extends Token {
+ private String text;
+
+ private FakeToken(final int t, final String txt) {
+ super(t, txt);
+ }
+
+ @Override
+ public String getText() {
+ return text;
+ }
+
+ @Override
+ public void setText(final String t) {
+ this.text = t;
+ }
+ }
+
+ private boolean isValidAttr(String tag, String name) {
+ try {
+ sanitizer.validateHtmlAttribute(new FakeToken(0, tag), new FakeToken(0,
name));
+ } catch (SemanticException e) {
+ return false;
+ }
+ return true;
+ }
+
+ private boolean isValidTag(String tagName) {
+ try {
+ sanitizer.validateHtmlElement(new FakeToken(0, tagName));
+ } catch (SemanticException e) {
+ return false;
+ }
+ return true;
+ }
+
+ private boolean isValidTag(Tag tag) {
+ return isValidTag(tag.getName());
+ }
+
+ /*
+ * Handling invalid tags by sanitizer
+ * */
+ private Tag firstInvalidTag = null;
+
+ private boolean hasInvalidParentTag() {
+ return firstInvalidTag != null;
+ }
+
+ private void cleanInvalidTag() {
+ this.firstInvalidTag = null;
+ }
+
+ private void setFirstInvalidTag(Tag firstInvalidTag) {
+ this.firstInvalidTag = firstInvalidTag;
+ }
+
+ private Tag getFirstInvalidTag() {
+ return this.firstInvalidTag;
+ }
+
+ /*
+ * Getters and Setters
+ * */
+
+ public HtmlToSeamTransformer getTransformer() {
+ return transformer;
+ }
+
+ public void setTransformer(HtmlToSeamTransformer transformer) {
+ this.transformer = transformer;
+ }
+}
Added:
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java
===================================================================
---
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java
(rev 0)
+++
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java 2009-03-28
16:22:49 UTC (rev 13275)
@@ -0,0 +1,449 @@
+package org.richfaces.convert.seamtext;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Stack;
+
+/**
+ * @user: akolonitsky
+ * Date: Mar 24, 2009
+ */
+public class HtmlToSeamTransformer {
+
+ private static final String HTML_A = "a";
+ private static final String HTML_H1 = "h1";
+ private static final String HTML_H2 = "h2";
+ private static final String HTML_H3 = "h3";
+ private static final String HTML_H4 = "h4";
+ private static final String HTML_P = "p";
+ private static final String HTML_UL = "ul";
+ private static final String HTML_OL = "ol";
+ private static final String HTML_LI = "li";
+ private static final String HTML_PRE = "pre";
+ private static final String HTML_TT = "tt";
+ private static final String HTML_DEL = "del";
+ private static final String HTML_SUP = "sup";
+ private static final String HTML_Q = "q";
+ private static final String HTML_I = "i";
+ private static final String HTML_U = "u";
+ private static final String HTML_BLOCKQOUTE = "blockqoute";
+
+ private static final String SEAM_MONOSPACE = "|";
+ private static final String SEAM_TWIDDLE = "~";
+ private static final String SEAM_HASH = "#";
+ private static final String SEAM_HAT = "^";
+ private static final String SEAM_PLUS = "+";
+ private static final String SEAM_STAR = "*";
+ private static final String SEAM_UNDERSCORE = "_";
+ private static final String SEAM_EQ = "=";
+ private static final String SEAM_BACKTICK = "`";
+ private static final String SEAM_DOUBLEQUOTE = "\"";
+ private static final String SEAM_LINK_START = "[";
+ private static final String SEAM_LINK_END = "]";
+
+ private static final String SEAM_GT = ">";
+ private static final String SEAM_LT = "<";
+ private static final String SEAM_AMP = "&";
+
+ private static final String BLANK_LINE = "\n\n";
+
+ public boolean preformatted = false;
+
+ private static final Collection<String> SEAM_TEXT_SYMBOLS = new
HashSet<String>(Arrays.asList(
+ SEAM_MONOSPACE,
+ SEAM_TWIDDLE,
+ SEAM_HASH,
+ SEAM_HAT,
+ SEAM_PLUS,
+ SEAM_STAR,
+ SEAM_UNDERSCORE,
+ SEAM_EQ,
+ SEAM_BACKTICK,
+ SEAM_DOUBLEQUOTE,
+ SEAM_LINK_START,
+ SEAM_LINK_END,
+ SEAM_LT,
+ SEAM_GT,
+ SEAM_AMP,
+
+ BLANK_LINE
+ ));
+
+
+ private static final Collection<String> SIMPLE_HTML_SEAM_TEXT_ELEMENTS = new
HashSet<String>(Arrays.asList(
+ HTML_DEL,
+ HTML_SUP,
+ HTML_PRE,
+ HTML_Q,
+ HTML_I,
+ HTML_TT,
+ HTML_U));
+
+ private static final Collection<String> FORMATTED_HTML_SEAM_TEXT_ELEMENTS = new
HashSet<String>(Arrays.asList(
+ HTML_H1,
+ HTML_H2,
+ HTML_H3,
+ HTML_H4,
+ HTML_P,
+ HTML_UL,
+ HTML_OL,
+ HTML_LI,
+ HTML_A,
+ HTML_BLOCKQOUTE));
+
+ private static final Collection<String> HTML_SEAM_TEXT_ELEMENTS =
+ new HashSet<String>(SIMPLE_HTML_SEAM_TEXT_ELEMENTS.size() +
FORMATTED_HTML_SEAM_TEXT_ELEMENTS.size());
+ static {
+ HTML_SEAM_TEXT_ELEMENTS.addAll(SIMPLE_HTML_SEAM_TEXT_ELEMENTS);
+ HTML_SEAM_TEXT_ELEMENTS.addAll(FORMATTED_HTML_SEAM_TEXT_ELEMENTS);
+ }
+
+ private Stack<Tag> htmlElementStack = new Stack<Tag>();
+
+ public Stack<Tag> getHtmlElementStack() {
+ return htmlElementStack;
+ }
+
+ public void setHtmlElementStack(Stack<Tag> htmlElementStack) {
+ this.htmlElementStack = htmlElementStack;
+ }
+
+ private StringBuilder mainBuilder = new StringBuilder();
+
+ private boolean isHeaderProcessed = false;
+
+ private boolean isFirstChars = false;
+
+ private StringBuilder builder = mainBuilder;
+
+ public StringBuilder newLinesCollector;
+
+ @Override
+ public String toString() {
+ return builder.toString();
+ }
+
+ private void append(String ... strings) {
+ for (String str : strings) {
+ builder.append(str);
+ }
+ }
+
+ public boolean isLink(Tag tag) {
+ return HTML_A.equalsIgnoreCase(tag.getName());
+ }
+
+ public boolean isHeader(Tag tag) {
+ final String name = tag.getName().toLowerCase();
+ return HTML_H1.equals(name) || HTML_H2.equals(name) || HTML_H3.equals(name) ||
HTML_H4.equals(name);
+ }
+
+ public boolean isParagraph(Tag tag) {
+ return HTML_P.equalsIgnoreCase(tag.getName());
+ }
+
+ public boolean isList(Tag token) {
+ final String name = token.getName().toLowerCase();
+ return HTML_UL.equals(name) || HTML_OL.equals(name);
+ }
+
+ public boolean isListItem(Tag token) {
+ final String name = token.getName().toLowerCase();
+ return HTML_LI.equals(name);
+ }
+
+ public boolean isPreFormattedElement(Tag tag) {
+ final String name = tag.getName().toLowerCase();
+ return HTML_PRE.equals(name) || HTML_TT.equals(name);
+ }
+
+ public String createSeamTextList() {
+ final String seamText;
+
+ final Tag parent = htmlElementStack.peek();
+ final String parentName = parent.getName().toLowerCase();
+ if (parentName.equals(HTML_UL)) {
+ seamText = SEAM_EQ;
+ } else if (parentName.equals(HTML_OL)) {
+ seamText = SEAM_HASH;
+ } else {
+ throw new IllegalStateException("<li> must follow <ol> or
<ul> not <" + parent.getName() + '>');
+ }
+
+ return seamText;
+ }
+
+ public boolean isPlainHtmlRequired(Tag name) {
+
+ if (!isSeamTextElement(name)) {
+ return true;
+ }
+
+ if (isSimpleSeamTextElement(name)) {
+ return false;
+ }
+
+ if (!HTML_A.equals(name.getName().toLowerCase())
+ && !HTML_P.equals(name.getName().toLowerCase())) {
+
+ for (Tag token : htmlElementStack) {
+ if (isHeader(token) || isListItem(token)) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
+
+ public String getSimpleSeamText(Tag tag) {
+
+ final String name = tag.getName().toLowerCase();
+ final StringBuilder seamText = new StringBuilder();
+
+ if (HTML_TT.equals(name)) {
+ seamText.append(SEAM_MONOSPACE);
+ } else if (HTML_DEL.equals(name)) {
+ seamText.append(SEAM_TWIDDLE);
+ } else if (HTML_I.equals(name)) {
+ seamText.append(SEAM_STAR);
+ } else if (HTML_SUP.equals(name)) {
+ seamText.append(SEAM_HAT);
+ } else if (HTML_U.equals(name)) {
+ seamText.append(SEAM_UNDERSCORE);
+ } else if (HTML_PRE.equals(name)) {
+ seamText.append(SEAM_BACKTICK);
+ } else if (HTML_Q.equals(name)) {
+ seamText.append(SEAM_DOUBLEQUOTE);
+ }
+ return seamText.toString();
+
+ }
+
+
+ public String escapeSeamText(String tokenName, boolean preformatted) {
+ final StringBuilder result = new StringBuilder();
+
+ if (preformatted) {
+ if ("<".equals(tokenName)) {
+ result.append('<');
+ } else if ("&".equals(tokenName)) {
+ result.append('&');
+ } else if (">".equals(tokenName)) {
+ result.append('>');
+ } else if (""".equals(tokenName)) {
+ result.append('"');
+ } else if (" ".equals(tokenName)) {
+ result.append(' ');
+ } else if (SEAM_TEXT_SYMBOLS.contains(tokenName)) {
+ result.append(tokenName);
+ }
+
+ } else {
+
+ if ("<".equals(tokenName)) {
+ result.append("\\<");
+ } else if ("&".equals(tokenName)) {
+ result.append("\\&");
+ } else if (">".equals(tokenName)) {
+ result.append("\\>");
+ } else if (""".equals(tokenName)) {
+ result.append('\"');
+ } else if (" ".equals(tokenName)) {
+ result.append(' ');
+ } else if ("\\".equals(tokenName)) {
+ result.append("\\\\");
+ } else if (SEAM_TEXT_SYMBOLS.contains(tokenName)) {
+ result.append('\\').append(tokenName);
+ }
+ }
+
+ return result.toString();
+ }
+
+
+ public boolean isSeamTextElement(Tag element) {
+ return HTML_SEAM_TEXT_ELEMENTS.contains(element.getName().toLowerCase());
+ }
+
+ public boolean isSimpleSeamTextElement(Tag element) {
+ return SIMPLE_HTML_SEAM_TEXT_ELEMENTS.contains(element.getName().toLowerCase());
+ }
+
+ public boolean isFormattedHtmlSeamTextElement(Tag element) {
+ return
FORMATTED_HTML_SEAM_TEXT_ELEMENTS.contains(element.getName().toLowerCase());
+ }
+
+ public void text(char[] text, int start, int length) {
+ if (isFirstChars) {
+// append(htmlElementStack.peek().printStartSuffix());
+
+ while (text[start] == '\n' && length > 0) {
+ start++;
+ length--;
+ }
+ isFirstChars = false;
+ }
+
+
+ while (length > 0) {
+ processChar(text, start, 1);
+
+ setHeaderProcessed();
+
+ start ++;
+ length --;
+ }
+ }
+
+ private void setHeaderProcessed() {
+ final Tag token = htmlElementStack.peek();
+ if (!isParagraph(token) && isHeaderProcessed) {
+ isHeaderProcessed = false;
+ }
+ }
+
+ private void processChar(final char[] text, final int start, final int localLength)
{
+ switch (text[start]) {
+ case '*': case '|': case '^' : case '+':
+ case '=': case '#': case '\\': case '~':
+ case '[': case ']': case '`' :
+ case '<': case '>': case '&':
+ seamCharacters(text, start, localLength);
+ break;
+
+ case '\n':
+ final Tag token = htmlElementStack.peek();
+ if (!(isParagraph(token)
+ || isHeaderProcessed
+ || HtmlToSeamSAXParser.ROOT_TAG_NAME.equals(token.getName())
+ || isList(token))) {
+ out(text, start, localLength);
+ }
+
+ break;
+ default:
+ out(text, start, localLength);
+ break;
+ }
+ }
+
+ public void seamCharacters(char[] text, int start, int length) {
+ append(escapeSeamText(new String(text, start, length), preformatted));
+ }
+
+ public void plain(char[] text, int start, int length) {
+ out(text, start, length);
+
+ setHeaderProcessed();
+ }
+
+ public void out(char[] text, int start, int length) {
+ append(new String(text, start, length));
+ }
+
+ public void space(char[] text, int start, int length) {
+ if (!htmlElementStack.isEmpty()) {
+ final Tag token = htmlElementStack.peek();
+ if (isPlainHtmlRequired(token)) {
+ out(text, start, length);
+ }
+ }
+ }
+
+ public void newline(char[] text, int start, int length) {
+ if (preformatted && newLinesCollector != null){
+ newLinesCollector.append(new String(text, start, length));
+ }
+ }
+
+ public void openTag(Tag tag) {
+
+ if (isPreFormattedElement(tag)) {
+ preformatted = true;
+ }
+
+ if (isPlainHtmlRequired(tag)) {
+ outValueCollector();
+ append(tag.printPlainStart());
+ } else {
+
+ if (isFormattedHtmlSeamTextElement(tag)) {
+ if (isLink(tag)) {
+ append(tag.printStart());
+ } else if (isList(tag)) {
+ } else if (isListItem(tag)) {
+ append(createSeamTextList());
+ } else if (isHeader(tag)) {
+ append(tag.printStart());
+ } else if (isParagraph(tag) && !isHeaderProcessed) {
+ }
+ } else if (isSimpleSeamTextElement(tag)) {
+
+ outValueCollector();
+ append(getSimpleSeamText(tag));
+ } else {
+ throw new IllegalStateException("Unknow situation. ");
+ }
+ }
+
+ isFirstChars = true;
+ }
+
+ private void outValueCollector() {
+ if (newLinesCollector != null) {
+ append(newLinesCollector.toString());
+ newLinesCollector = null;
+ }
+ }
+
+ public void closeTagWithBody(Tag tag) {
+ if (!tag.getName().equals(tag.getName())) {
+ throw new IllegalStateException("Can not convert to the Seam Text:
</" + tag.getName() + "> expected");
+ }
+
+ String value = "";
+ if (newLinesCollector != null) {
+ value = newLinesCollector.toString();
+ }
+
+ if (isPlainHtmlRequired(tag)) {
+ append(value);
+ append(tag.printPlainEnd());
+ } else {
+ if (isFormattedHtmlSeamTextElement(tag)) {
+ if (isLink(tag)) {
+ append(tag.printEnd());
+ } else if (isParagraph(tag)) {
+ append(value);
+ append(tag.printEnd());
+
+ isHeaderProcessed = false;
+ } else {
+ append(value);
+ }
+
+ if (isList(tag) || isListItem(tag)) {
+ append("\n");
+ } else if (isHeader(tag)) {
+ append(tag.printEnd());
+ isHeaderProcessed = true;
+ }
+
+ } else if (isSimpleSeamTextElement(tag)) {
+ append(value.trim());
+ append(getSimpleSeamText(tag));
+ } else {
+ throw new IllegalStateException("Unknow situation. ");
+ }
+ }
+
+
+ newLinesCollector = null;
+ if (isPreFormattedElement(tag)) {
+ preformatted = false;
+ }
+ }
+}
+
Added: trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/Tag.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/Tag.java
(rev 0)
+++ trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/Tag.java 2009-03-28
16:22:49 UTC (rev 13275)
@@ -0,0 +1,106 @@
+package org.richfaces.convert.seamtext;
+
+import java.util.Map;
+
+/**
+ * @user: akolonitsky
+ * Date: Mar 24, 2009
+ */
+public class Tag {
+ private String name;
+ private Map<String, String> attributes;
+
+ private boolean isEmpty = true;
+
+ public Tag() {
+ }
+
+ public Tag(String name) {
+ setName(name);
+ }
+
+ public Tag(String name, Map<String, String> attributes) {
+ setName(name);
+ setAttributes(attributes);
+ }
+
+ public String printPlainStart(){
+ final StringBuilder builder = new StringBuilder();
+ builder.append('<').append(getName());
+
+ if (!attributes.isEmpty()) {
+ builder.append(' ').append(printAttributes());
+ }
+ builder.append('>');
+
+ return builder.toString();
+ }
+
+ public String printStartSuffix(){
+ return ">";
+ }
+
+ public String printStart(){
+ return printPlainStart();
+ }
+
+ private String printAttributes() {
+ if (attributes == null) {
+ return "";
+ }
+
+ final StringBuilder builder = new StringBuilder();
+ for (Map.Entry<String, String> pair : attributes.entrySet()) {
+
builder.append(pair.getKey()).append("=\"").append(pair.getValue()).append("\"
");
+ }
+ return builder.substring(0, builder.length() - 1);
+ }
+
+ public String printPlainEnd(){
+ if (isEmpty) {
+// return "/>";
+ }
+
+ final StringBuilder builder = new StringBuilder(getName().length() + 3);
+ builder.append("</").append(getName()).append('>');
+
+ return builder.toString();
+ }
+
+ public void setEmpty() {
+ isEmpty = true;
+ }
+
+ public void setNotEmpty() {
+ isEmpty = false;
+ }
+
+ public String printEnd(){
+ return printPlainEnd();
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getAttribute(String attr) {
+ return attributes.get(attr);
+ }
+
+ public Map<String, String> getAttributes() {
+ return attributes;
+ }
+
+ public void setAttributes(Map<String, String> attributes) {
+ this.attributes = attributes;
+ }
+
+ @Override
+ public String toString() {
+ return printStart();
+ }
+}
Added: trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/TagFactory.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/TagFactory.java
(rev 0)
+++
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/TagFactory.java 2009-03-28
16:22:49 UTC (rev 13275)
@@ -0,0 +1,89 @@
+package org.richfaces.convert.seamtext;
+
+import java.util.*;
+
+/**
+ * @user: akolonitsky
+ * Date: Mar 25, 2009
+ */
+
+public class TagFactory {
+ /**
+ * Collection of special Seam Tags
+ * */
+ private static final Collection<Tag> TAGS = Arrays.asList(
+ getNewTagDefinition("h1", "+ ", "\n"),
+ getNewTagDefinition("h2", "++ ", "\n"),
+ getNewTagDefinition("h3", "+++ ", "\n"),
+ getNewTagDefinition("h4", "++++ ", "\n"),
+ getNewTagDefinition("p", "", "\n\n"),
+ getNewTagDefinition("i", "*", "*"),
+ new Tag("a") {
+ @Override
+ public String printStart() {
+ return "[";
+ }
+
+ @Override
+ public String printEnd() {
+ String s = getAttribute("href");
+ if (s == null) {
+ s = "/";
+ }
+ return "=>"+ s + ']';
+ }
+
+ @Override
+ public String printStartSuffix() {
+ return "";
+ }
+ }
+ );
+
+ private static final Map<String, Tag> TAGS_MAP = new HashMap<String,
Tag>(TAGS.size());
+ static {
+ for (Tag tag : TAGS) {
+ TAGS_MAP.put(tag.getName(), tag);
+ }
+ }
+
+// private static Tag getNewTagDefinition(final String tagName, final String startTag)
{
+// return getNewTagDefinition(tagName, startTag, "");
+// }
+
+ /**
+ * Create subclass for Tag class with overrided printStart, printEnd methods
+ * */
+ private static Tag getNewTagDefinition(final String tagName, final String startTag,
final String endTag) {
+ return new Tag(tagName) {
+ @Override
+ public String printStart() {
+ return startTag;
+ }
+
+ @Override
+ public String printEnd() {
+ return endTag;
+ }
+
+ @Override
+ public String printStartSuffix() {
+ return "";
+ }
+ };
+ }
+
+ public Tag getInstance(String tagName) {
+ return getInstance(tagName, null);
+ }
+
+ public Tag getInstance(String tagName, Map<String, String> attr) {
+ Tag tag = TAGS_MAP.get(tagName);
+ if (tag == null) {
+ tag = new Tag(tagName);
+ }
+ tag.setAttributes(attr);
+
+ return tag;
+ }
+}
Modified: trunk/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java
===================================================================
---
trunk/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java 2009-03-28
00:31:19 UTC (rev 13274)
+++
trunk/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java 2009-03-28
16:22:49 UTC (rev 13275)
@@ -1,303 +1,767 @@
-/**
- * License Agreement.
- *
- * Rich Faces - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
package org.richfaces.seamparser;
-import java.io.StringReader;
-
+import antlr.RecognitionException;
+import antlr.TokenStreamException;
import junit.framework.TestCase;
-
import org.jboss.seam.text.SeamTextLexer;
import org.jboss.seam.text.SeamTextParser;
-import org.richfaces.antlr.HtmlSeamTextLexer;
-import org.richfaces.antlr.HtmlSeamTextParser;
+import org.richfaces.convert.seamtext.HtmlToSeamSAXParser;
+import java.io.StringReader;
+
/**
- * HtmlSeamParser Junit Test
- * @author Denis Morozov
- *
+ * @user: akolonitsky
+ * Date: Mar 25, 2009
*/
public class HtmlSeamParserTest extends TestCase {
- private final static String SEAM_TEXT_EXPRESSION_1 = "It's easy to make
*emphasis*, |monospace|, "
- + "~deleted text~, super^scripts^ or_underlines_.";
+ private final static String SEAM_TEXT_EXPRESSION_1 = "It's easy to make
*emphasis*, |monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_.";
- private final static String SEAM_TEXT_EXPRESSION_2 = "+ This is a big
heading\n"
- + "You /must/ have some text following a heading!\n\n"
- + "++ This is a smaller heading\n"
- + "This is the first paragraph. We can split it across multiple"
- + "lines, but we must end it with a blank line.\n\n"
- + "This is the second paragraph.";
+ private final static String SEAM_TEXT_EXPRESSION_2 = "+ This is a big
heading\n"
+ + "You /must/ have some text following a heading!\n\n"
+ + "++ This is a smaller heading\n"
+ + "This is the first paragraph. We can split it across multiple"
+ + "lines, but we must end it with a blank line.\n\n"
+ + "This is the second paragraph.";
- private final static String SEAM_TEXT_EXPRESSION_3 = "An ordered list:\n\n"
- + "# first item\n" + "# second item\n"
- + "# and even the /third/ item\n\n" + "An unordered list:\n\n"
- + "= an item\n" + "= another item";
+ private final static String SEAM_TEXT_EXPRESSION_3 = "An ordered
list:\n\n"
+ + "# first item\n" + "# second item\n"
+ + "# and even the /third/ item\n\n" + "An unordered
list:\n\n"
+ + "= an item\n" + "= another item";
- private final static String SEAM_TEXT_EXPRESSION_4 = "The other guy said: "+
"\"Nyeah nyeah-nee\"";
-
- private final static String SEAM_TEXT_EXPRESSION_5 = "You can write down equations
like 2\\*3\\+4-7\\=3 and HTML tagslike \\<body\\> using the escape character: \\\\.
foo(a)tut.by, 100$ cash 100%";
+ private final static String SEAM_TEXT_EXPRESSION_4 = "The other guy said: "
+ "\"Nyeah nyeah-nee\"";
- private final static String SEAM_TEXT_EXPRESSION_6 = "My code doesn't
work:"
- + "`for (int i=0; i<100; i--)\n"
- + "{\n"
- + "doSomething(){ String str = \"& >"
\"; }; doSomething();\n"
- + "doSomething() " +
- "}`" + " Any ideas?";
-
- private final static String SEAM_TEXT_EXPRESSION_7 = "+ test
value<h1>test1<h2>test2</h2>test4</h1>\ntest";
-
- private final static String SEAM_TEXT_EXPRESSION_8 = "++ test
value<h1>test1<h2>test2</h2>test4</h1>\ntest";
-
- private final static String SEAM_TEXT_EXPRESSION_9 = "+++ test
value<h1>test1<h2>test2</h2>test4</h1>\ntest";
-
- private final static String SEAM_TEXT_EXPRESSION_10 = "++++ test
value<h1>test1<h2>test2</h2>test4</h1>\ntest";
-
- private final static String SEAM_TEXT_EXPRESSION_11 = "+ test
value<div>test5</div><h1>test1<div>test2</div>test4</h1>\ntest";
+ private final static String SEAM_TEXT_EXPRESSION_5 =
+ "You can write down equations like 2\\*3\\+4-7\\=3 and HTML tagslike
\\<body\\> using the escape character: \\\\. foo(a)tut.by, 100$ cash 100%";
- private final static String SEAM_TEXT_EXPRESSION_12 = "[test
link=>http://test.com]";
-
- private final static String SEAM_TEXT_EXPRESSION_13 =
"[=>http://test.com]";
-
- private final static String SEAM_TEXT_EXPRESSION_14 = "This is a |<tag
attribute=\"value\"/>| example.";
-
- private final static String SEAM_TEXT_EXPRESSION_15 = "= <div
class=\"testClass1 testClass2\"></div><h1> test value
</h1>";
-
- private final static String SEAM_TEXT_EXPRESSION_16 = "# <div
class=\"testClass1 testClass2\"></div><h1> test value
</h1>";
+ private final static String SEAM_TEXT_EXPRESSION_6 = "My code doesn't
work:"
+ + "`for (int i=0; i<100; i--)\n"
+ + "{\n"
+ + "doSomething(){ String str =
\"& >" \"; }; doSomething();\n"
+ + "doSomething() " +
+ "}`" + " Any ideas?";
- private final static String SEAM_TEXT_EXPRESSION_17 = "paragraph\n\n+ header\ntext
after header\n\nanother paragraph";
+ private final static String SEAM_TEXT_EXPRESSION_7 = "+ test
value<h1>test1<h2>test2</h2>test4</h1>\ntest";
- private final static String SEAM_TEXT_EXPRESSION_18 = "paragraph\n\n++ header\ntext
after header\n\nanother paragraph";
-
- private final static String SEAM_TEXT_EXPRESSION_19 = "paragraph\n\n+++
header\ntext after header\n\nanother paragraph";
-
- private final static String SEAM_TEXT_EXPRESSION_20 = "paragraph\n\n++++
header\ntext after header\n\nanother paragraph";
-
- private final static String SEAM_TEXT_EXPRESSION_21 = "paragraph\n\n= item1\n=
item2\n= item3\n\nanother paragraph";
-
- private final static String SEAM_TEXT_EXPRESSION_22 = "paragraph\n\n# item1\n#
item2\n# item3\n\nanother paragraph";
-
- private final static String SEAM_TEXT_EXPRESSION_23 = "+ header text *emphasis*,
|monospace|, "
- + "~deleted text~, super^scripts^ or_underlines_\n text after header *emphasis*,
|monospace|, "
- + "~deleted text~, super^scripts^ or_underlines_";
-
- private final static String SEAM_TEXT_EXPRESSION_24 = "++ header text *emphasis*,
|monospace|, "
- + "~deleted text~, super^scripts^ or_underlines_\n text after header *emphasis*,
|monospace|, "
- + "~deleted text~, super^scripts^ or_underlines_";
+ private final static String SEAM_TEXT_EXPRESSION_8 = "++ test
value<h1>test1<h2>test2</h2>test4</h1>\ntest";
- private final static String SEAM_TEXT_EXPRESSION_25 = "+++ header text *emphasis*,
|monospace|, "
- + "~deleted text~, super^scripts^ or_underlines_\n text after header *emphasis*,
|monospace|, "
- + "~deleted text~, super^scripts^ or_underlines_";
+ private final static String SEAM_TEXT_EXPRESSION_9 = "+++ test
value<h1>test1<h2>test2</h2>test4</h1>\ntest";
- private final static String SEAM_TEXT_EXPRESSION_26 = "++++ header text *emphasis*,
|monospace|, "
- + "~deleted text~, super^scripts^ or_underlines_\n text after header *emphasis*,
|monospace|, "
- + "~deleted text~, super^scripts^ or_underlines_";
+ private final static String SEAM_TEXT_EXPRESSION_10 = "++++ test
value<h1>test1<h2>test2</h2>test4</h1>\ntest";
-
- private final static String SEAM_TEXT_EXPRESSION_27 = "= item1 *emphasis*,
|monospace|, "
- + "~deleted text~, super^scripts^ or_underlines_\n= item2 *emphasis*, |monospace|,
"
- + "~deleted text~, super^scripts^ or_underlines_";
-
- private final static String SEAM_TEXT_EXPRESSION_28 = "# item1 *emphasis*,
|monospace|, "
- + "~deleted text~, super^scripts^ or_underlines_\n# item2 *emphasis*, |monospace|,
"
- + "~deleted text~, super^scripts^ or_underlines_";
-
- private final static String SEAM_TEXT_EXPRESSION_29 = "A, B, C, D, E, F, G, H, I,
J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9";
-
- private final static String SEAM_TEXT_EXPRESSION_30 = "<div/>";
+ private final static String SEAM_TEXT_EXPRESSION_11 = "+ test
value<div>test5</div><h1>test1<div>test2</div>test4</h1>\ntest";
-
-
- public HtmlSeamParserTest(String name) {
- super(name);
- }
- public void testSeamTextConverting1() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_1);
- }
+ private final static String SEAM_TEXT_EXPRESSION_12 = "[test
link=>http://test.com]";
- public void testStandartSeamTextConverting2() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_2);
- }
+ private final static String SEAM_TEXT_EXPRESSION_13 =
"[=>http://test.com]";
- public void testStandartSeamTextConverting3() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_3);
- }
-
- public void testStandartSeamTextConverting4() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_4);
- }
+ private final static String SEAM_TEXT_EXPRESSION_14 = "This is a |<tag
attribute=\"value\"/>| example.";
- public void testStandartSeamTextConverting5() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_5);
- }
+ private final static String SEAM_TEXT_EXPRESSION_15 = "= <div
class=\"testClass1 testClass2\"></div><h1> test value
</h1>";
- public void testStandartSeamTextConverting6() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_6);
- }
-
- public void testStandartSeamTextConverting7() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_7);
- }
-
- public void testStandartSeamTextConverting8() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_8);
- }
-
- public void testStandartSeamTextConverting9() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_9);
- }
-
- public void testStandartSeamTextConverting10() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_10);
- }
-
- public void testStandartSeamTextConverting11() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_11);
- }
-
- public void testStandartSeamTextConverting12() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_12);
- }
-
- public void testStandartSeamTextConverting13() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_13);
- }
+ private final static String SEAM_TEXT_EXPRESSION_16 = "# <div
class=\"testClass1 testClass2\"></div><h1> test value
</h1>";
- public void testStandartSeamTextConverting14() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_14);
- }
-
- public void testStandartSeamTextConverting15() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_15);
- }
-
- public void testStandartSeamTextConverting16() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_16);
- }
+ private final static String SEAM_TEXT_EXPRESSION_17 = "paragraph\n\n+
header\ntext after header\n\nanother paragraph";
- public void testStandartSeamTextConverting17() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_17);
- }
+ private final static String SEAM_TEXT_EXPRESSION_18 = "paragraph\n\n++
header\ntext after header\n\nanother paragraph";
-
- public void testStandartSeamTextConverting18() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_18);
- }
+ private final static String SEAM_TEXT_EXPRESSION_19 = "paragraph\n\n+++
header\ntext after header\n\nanother paragraph";
- public void testStandartSeamTextConverting19() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_19);
- }
+ private final static String SEAM_TEXT_EXPRESSION_20 = "paragraph\n\n++++
header\ntext after header\n\nanother paragraph";
- public void testStandartSeamTextConverting20() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_20);
- }
+ private final static String SEAM_TEXT_EXPRESSION_21 = "paragraph\n\n= item1\n=
item2\n= item3\n\nanother paragraph";
- public void testStandartSeamTextConverting21() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_21);
- }
-
- public void testStandartSeamTextConverting22() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_22);
- }
-
- public void testStandartSeamTextConverting23() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_23);
- }
-
- public void testStandartSeamTextConverting24() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_24);
- }
+ private final static String SEAM_TEXT_EXPRESSION_22 = "paragraph\n\n# item1\n#
item2\n# item3\n\nanother paragraph";
- public void testStandartSeamTextConverting25() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_25);
- }
-
- public void testStandartSeamTextConverting26() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_26);
- }
+ private final static String SEAM_TEXT_EXPRESSION_23 = "+ header text *emphasis*,
|monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_\n text after header
*emphasis*, |monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_";
- public void testStandartSeamTextConverting27() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_27);
- }
-
- public void testStandartSeamTextConverting28() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_28);
- }
-
- public void testStandartSeamTextConverting29() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_29);
- }
-
- public void testStandartSeamTextConverting30() throws Exception {
- assertSeamConverting(SEAM_TEXT_EXPRESSION_30);
- }
+ private final static String SEAM_TEXT_EXPRESSION_24 = "++ header text
*emphasis*, |monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_\n text after header
*emphasis*, |monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_";
- public void testRF5717() throws Exception {
- assertHtml2SeamConverting("<p>a&b</p>",
"a&b");
- }
-
+ private final static String SEAM_TEXT_EXPRESSION_25 = "+++ header text
*emphasis*, |monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_\n text after header
*emphasis*, |monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_";
+ private final static String SEAM_TEXT_EXPRESSION_26 = "++++ header text
*emphasis*, |monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_\n text after header
*emphasis*, |monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_";
-
-
+ private final static String SEAM_TEXT_EXPRESSION_27 = "= item1 *emphasis*,
|monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_\n= item2 *emphasis*,
|monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_";
+ private final static String SEAM_TEXT_EXPRESSION_28 = "# item1 *emphasis*,
|monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_\n# item2 *emphasis*,
|monospace|, "
+ + "~deleted text~, super^scripts^ or_underlines_";
- /**
- * Method to assert converting from Seam Text to html and back
- * @param htmlText
- * @throws Exception
- */
- private void assertHtml2SeamConverting(String htmlText, String resultContain)
- throws Exception {
-
- HtmlSeamTextParser htmlParser = new HtmlSeamTextParser(
- new HtmlSeamTextLexer(new StringReader(htmlText)));
- htmlParser.startRule();
- String seamText = htmlParser.toString();
+ private final static String SEAM_TEXT_EXPRESSION_29 = "A, B, C, D, E, F, G, H,
I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9";
- SeamTextParser seamParser = new SeamTextParser(
- new SeamTextLexer(new StringReader(seamText)));
- seamParser.startRule();
- String html = seamParser.toString();
+// private final static String SEAM_TEXT_EXPRESSION_30 = "<div/>";
+
+
+ public HtmlSeamParserTest(String name) {
+ super(name);
+ }
+
+ public void testSeamTextConverting1() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_1);
+ }
+
+ public void testStandartSeamTextConverting2() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_2);
+ }
+
+ public void testStandartSeamTextConverting3() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_3);
+ }
+
+ public void testStandartSeamTextConverting4() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_4);
+ }
+
+ public void testStandartSeamTextConverting5() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_5);
+ }
+
+ public void testStandartSeamTextConverting6() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_6);
+ }
+
+ public void testStandartSeamTextConverting7() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_7);
+ }
+
+ public void testStandartSeamTextConverting8() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_8);
+ }
+
+ public void testStandartSeamTextConverting9() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_9);
+ }
+
+ public void testStandartSeamTextConverting10() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_10);
+ }
+
+ public void testStandartSeamTextConverting11() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_11);
+ }
+
+ public void testStandartSeamTextConverting12() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_12);
+ }
+
+ public void testStandartSeamTextConverting13() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_13);
+ }
+
+ public void testStandartSeamTextConverting14() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_14);
+ }
+
+ public void testStandartSeamTextConverting15() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_15);
+ }
+
+ public void testStandartSeamTextConverting16() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_16);
+ }
+
+ public void testStandartSeamTextConverting17() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_17);
+ }
+
+
+ public void testStandartSeamTextConverting18() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_18);
+ }
+
+ public void testStandartSeamTextConverting19() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_19);
+ }
+
+ public void testStandartSeamTextConverting20() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_20);
+ }
+
+ public void testStandartSeamTextConverting21() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_21);
+ }
+
+ public void testStandartSeamTextConverting22() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_22);
+ }
+
+ public void testStandartSeamTextConverting23() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_23);
+ }
+
+ public void testStandartSeamTextConverting24() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_24);
+ }
+
+ public void testStandartSeamTextConverting25() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_25);
+ }
+
+ public void testStandartSeamTextConverting26() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_26);
+ }
+
+ public void testStandartSeamTextConverting27() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_27);
+ }
+
+ public void testStandartSeamTextConverting28() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_28);
+ }
+
+ public void testStandartSeamTextConverting29() throws Exception {
+ assertSeamConverting(SEAM_TEXT_EXPRESSION_29);
+ }
+
+// public void testStandartSeamTextConverting30() throws Exception {
+// assertSeamConverting(SEAM_TEXT_EXPRESSION_30);
+// }
+
+ public void testRF5717() throws Exception {
+ assertHtml2SeamConverting("<p>a<b
a&b</p>");
+ }
+
+ public void testRF5717_() throws Exception {
+ assertHtml2SeamConverting("<p><b>aaaaaaaaa <u><i
class=\"seamTextEmphasis\">sssssssss</i>
dddddddddddddddd</u></b></p>");
+ }
+
+// public void testRF5717__() throws Exception {
+// assertHtml2SeamConverting("<P><STRONG>aaaaaaaaad
<U><B>ddddddddddddd</B>
sssssssssssss</U></STRONG></P>", "");
+// }
+
+ public void testRF5798_() throws Exception {
+ assertHtml2SeamConverting("<!-- Hello Cfif -->");
+ }
+
+ public void noTestRF5798__() throws Exception {
+ final String str = "<p><meta content=\"text/html;
charset=utf-8\" http-equiv=\"Content-Type\"/><meta
content=\"Word.Document\" name=\"ProgId\"/><meta
content=\"Microsoft Word 12\" name=\"Generator\"/><meta
content=\"Microsoft Word 12\" name=\"Originator\"/><link
href=\"file:///E:\\TEMP~1\\msohtmlclip1\\01\\clip_filelist.xml\"
rel=\"File-List\"/><link
href=\"file:///E:\\TEMP~1\\msohtmlclip1\\01\\clip_themedata.thmx\"
rel=\"themeData\"/><link
href=\"file:///E:\\TEMP~1\\msohtmlclip1\\01\\clip_colorschememapping.xml\"
rel=\"colorSchemeMapping\"/>" +
+ "<!--[if gte mso 9]><xml>\n" +
+ " <w:WordDocument>\n" +
+ " <w:View>Normal</w:View>\n" +
+ " <w:Zoom>0</w:Zoom>\n" +
+ " <w:TrackMoves/>\n" +
+ " <w:TrackFormatting/>\n" +
+ " <w:PunctuationKerning/>\n" +
+ " <w:ValidateAgainstSchemas/>\n" +
+ "
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>\n" +
+ "
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>\n" +
+ "
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>\n" +
+ " <w:DoNotPromoteQF/>\n" +
+ " <w:LidThemeOther>EN-US</w:LidThemeOther>\n" +
+ " <w:LidThemeAsian>X-NONE</w:LidThemeAsian>\n" +
+ "
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>\n" +
+ " <w:Compatibility>\n" +
+ " <w:BreakWrappedTables/>\n" +
+ " <w:SnapToGridInCell/>\n" +
+ " <w:WrapTextWithPunct/>\n" +
+ " <w:UseAsianBreakRules/>\n" +
+ " <w:DontGrowAutofit/>\n" +
+ " <w:SplitPgBreakAndParaMark/>\n" +
+ " <w:DontVertAlignCellWithSp/>\n" +
+ " <w:DontBreakConstrainedForcedTables/>\n" +
+ " <w:DontVertAlignInTxbx/>\n" +
+ " <w:Word11KerningPairs/>\n" +
+ " <w:CachedColBalance/>\n" +
+ " </w:Compatibility>\n" +
+ "
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>\n" +
+ " <m:mathPr>\n" +
+ " <m:mathFont m:val=\"Cambria Math\"/>\n" +
+ " <m:brkBin m:val=\"before\"/>\n" +
+ " <m:brkBinSub m:val=\"-\"/>\n" +
+ " <m:smallFrac m:val=\"off\"/>\n" +
+ " <m:dispDef/>\n" +
+ " <m:lMargin m:val=\"0\"/>\n" +
+ " <m:rMargin m:val=\"0\"/>\n" +
+ " <m:defJc m:val=\"centerGroup\"/>\n" +
+ " <m:wrapIndent m:val=\"1440\"/>\n" +
+ " <m:intLim m:val=\"subSup\"/>\n" +
+ " <m:naryLim m:val=\"undOvr\"/>\n" +
+ " </m:mathPr></w:WordDocument>\n" +
+ "</xml><![endif]-->" +
+ "<!--[if gte mso 9]><xml>\n" +
+ " <w:LatentStyles DefLockedState=\"false\"
DefUnhideWhenUsed=\"true\"\n" +
+ " DefSemiHidden=\"true\" DefQFormat=\"false\"
DefPriority=\"99\"\n" +
+ " LatentStyleCount=\"267\">\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"0\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" QFormat=\"true\"
Name=\"Normal\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"9\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" QFormat=\"true\"
Name=\"heading 1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"9\" QFormat=\"true\" Name=\"heading
2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"9\" QFormat=\"true\" Name=\"heading
3\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"9\" QFormat=\"true\" Name=\"heading
4\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"9\" QFormat=\"true\" Name=\"heading
5\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"9\" QFormat=\"true\" Name=\"heading
6\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"9\" QFormat=\"true\" Name=\"heading
7\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"9\" QFormat=\"true\" Name=\"heading
8\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"9\" QFormat=\"true\" Name=\"heading
9\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"39\" Name=\"toc 1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"39\" Name=\"toc 2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"39\" Name=\"toc 3\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"39\" Name=\"toc 4\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"39\" Name=\"toc 5\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"39\" Name=\"toc 6\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"39\" Name=\"toc 7\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"39\" Name=\"toc 8\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"39\" Name=\"toc 9\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"35\" QFormat=\"true\"
Name=\"caption\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"10\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" QFormat=\"true\"
Name=\"Title\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"1\" Name=\"Default Paragraph Font\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"11\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" QFormat=\"true\"
Name=\"Subtitle\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"22\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" QFormat=\"true\"
Name=\"Strong\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"20\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" QFormat=\"true\"
Name=\"Emphasis\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"59\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Table
Grid\"/>\n" +
+ " <w:LsdException Locked=\"false\"
UnhideWhenUsed=\"false\" Name=\"Placeholder Text\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"1\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" QFormat=\"true\"
Name=\"No Spacing\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"60\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light
Shading\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"61\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light
List\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"62\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light
Grid\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"63\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Shading
1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"64\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Shading
2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"65\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium List
1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"66\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium List
2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"67\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid
1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"68\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid
2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"69\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid
3\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"70\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Dark
List\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"71\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful
Shading\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"72\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful
List\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"73\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful
Grid\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"60\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light Shading
Accent 1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"61\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light List Accent
1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"62\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light Grid Accent
1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"63\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Shading 1
Accent 1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"64\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Shading 2
Accent 1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"65\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium List 1
Accent 1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
UnhideWhenUsed=\"false\" Name=\"Revision\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"34\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" QFormat=\"true\"
Name=\"List Paragraph\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"29\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" QFormat=\"true\"
Name=\"Quote\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"30\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" QFormat=\"true\"
Name=\"Intense Quote\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"66\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium List 2
Accent 1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"67\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid 1
Accent 1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"68\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid 2
Accent 1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"69\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid 3
Accent 1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"70\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Dark List Accent
1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"71\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful Shading
Accent 1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"72\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful List
Accent 1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"73\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful Grid
Accent 1\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"60\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light Shading
Accent 2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"61\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light List Accent
2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"62\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light Grid Accent
2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"63\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Shading 1
Accent 2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"64\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Shading 2
Accent 2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"65\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium List 1
Accent 2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"66\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium List 2
Accent 2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"67\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid 1
Accent 2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"68\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid 2
Accent 2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"69\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid 3
Accent 2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"70\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Dark List Accent
2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"71\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful Shading
Accent 2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"72\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful List
Accent 2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"73\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful Grid
Accent 2\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"60\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light Shading
Accent 3\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"61\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light List Accent
3\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"62\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light Grid Accent
3\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"63\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Shading 1
Accent 3\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"64\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Shading 2
Accent 3\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"65\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium List 1
Accent 3\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"66\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium List 2
Accent 3\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"67\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid 1
Accent 3\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"68\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid 2
Accent 3\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"69\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid 3
Accent 3\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"70\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Dark List Accent
3\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"71\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful Shading
Accent 3\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"72\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful List
Accent 3\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"73\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful Grid
Accent 3\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"60\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light Shading
Accent 4\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"61\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light List Accent
4\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"62\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light Grid Accent
4\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"63\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Shading 1
Accent 4\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"64\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Shading 2
Accent 4\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"65\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium List 1
Accent 4\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"66\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium List 2
Accent 4\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"67\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid 1
Accent 4\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"68\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid 2
Accent 4\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"69\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid 3
Accent 4\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"70\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Dark List Accent
4\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"71\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful Shading
Accent 4\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"72\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful List
Accent 4\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"73\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful Grid
Accent 4\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"60\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light Shading
Accent 5\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"61\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light List Accent
5\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"62\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light Grid Accent
5\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"63\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Shading 1
Accent 5\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"64\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Shading 2
Accent 5\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"65\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium List 1
Accent 5\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"66\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium List 2
Accent 5\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"67\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid 1
Accent 5\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"68\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid 2
Accent 5\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"69\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid 3
Accent 5\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"70\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Dark List Accent
5\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"71\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful Shading
Accent 5\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"72\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful List
Accent 5\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"73\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful Grid
Accent 5\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"60\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light Shading
Accent 6\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"61\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light List Accent
6\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"62\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Light Grid Accent
6\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"63\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Shading 1
Accent 6\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"64\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Shading 2
Accent 6\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"65\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium List 1
Accent 6\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"66\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium List 2
Accent 6\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"67\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid 1
Accent 6\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"68\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid 2
Accent 6\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"69\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Medium Grid 3
Accent 6\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"70\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Dark List Accent
6\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"71\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful Shading
Accent 6\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"72\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful List
Accent 6\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"73\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" Name=\"Colorful Grid
Accent 6\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"19\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" QFormat=\"true\"
Name=\"Subtle Emphasis\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"21\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" QFormat=\"true\"
Name=\"Intense Emphasis\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"31\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" QFormat=\"true\"
Name=\"Subtle Reference\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"32\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" QFormat=\"true\"
Name=\"Intense Reference\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"33\" SemiHidden=\"false\"\n" +
+ " UnhideWhenUsed=\"false\" QFormat=\"true\"
Name=\"Book Title\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"37\" Name=\"Bibliography\"/>\n" +
+ " <w:LsdException Locked=\"false\"
Priority=\"39\" QFormat=\"true\" Name=\"TOC
Heading\"/>\n" +
+ " </w:LatentStyles>\n" +
+ "</xml><![endif]" +
+ "-->" +
+ "<style>\n" +
+ "<!--\n" +
+ " /* Font Definitions */\n" +
+ " @font-face\n" +
+ "\t{font-family:\"Cambria Math\";\n" +
+ "\tpanose-1:2 4 5 3 5 4 6 3 2 4;\n" +
+ "\tmso-font-charset:204;\n" +
+ "\tmso-generic-font-family:roman;\n" +
+ "\tmso-font-pitch:variable;\n" +
+ "\tmso-font-signature:-1610611985 1107304683 0 0 159 0;}\n" +
+ "@font-face\n" +
+ "\t{font-family:Calibri;\n" +
+ "\tpanose-1:2 15 5 2 2 2 4 3 2 4;\n" +
+ "\tmso-font-charset:204;\n" +
+ "\tmso-generic-font-family:swiss;\n" +
+ "\tmso-font-pitch:variable;\n" +
+ "\tmso-font-signature:-1610611985 1073750139 0 0 159 0;}\n" +
+ " /* Style Definitions */\n" +
+ " p.MsoNormal, li.MsoNormal, div.MsoNormal\n" +
+ "\t{mso-style-unhide:no;\n" +
+ "\tmso-style-qformat:yes;\n" +
+ "\tmso-style-parent:\"\";\n" +
+ "\tmargin-top:0in;\n" +
+ "\tmargin-right:0in;\n" +
+ "\tmargin-bottom:10.0pt;\n" +
+ "\tmargin-left:0in;\n" +
+ "\tline-height:115%;\n" +
+ "\tmso-pagination:widow-orphan;\n" +
+ "\tfont-size:11.0pt;\n" +
+
"\tfont-family:\"Calibri\",\"sans-serif\";\n" +
+ "\tmso-ascii-font-family:Calibri;\n" +
+ "\tmso-ascii-theme-font:minor-latin;\n" +
+ "\tmso-fareast-font-family:Calibri;\n" +
+ "\tmso-fareast-theme-font:minor-latin;\n" +
+ "\tmso-hansi-font-family:Calibri;\n" +
+ "\tmso-hansi-theme-font:minor-latin;\n" +
+ "\tmso-bidi-font-family:\"Times New Roman\";\n" +
+ "\tmso-bidi-theme-font:minor-bidi;}\n" +
+ "a:link, span.MsoHyperlink\n" +
+ "\t{mso-style-noshow:yes;\n" +
+ "\tmso-style-priority:99;\n" +
+ "\tcolor:blue;\n" +
+ "\ttext-decoration:underline;\n" +
+ "\ttext-underline:single;}\n" +
+ "a:visited, span.MsoHyperlinkFollowed\n" +
+ "\t{mso-style-noshow:yes;\n" +
+ "\tmso-style-priority:99;\n" +
+ "\tcolor:purple;\n" +
+ "\tmso-themecolor:followedhyperlink;\n" +
+ "\ttext-decoration:underline;\n" +
+ "\ttext-underline:single;}\n" +
+ "p\n" +
+ "\t{mso-style-noshow:yes;\n" +
+ "\tmso-style-priority:99;\n" +
+ "\tmso-margin-top-alt:auto;\n" +
+ "\tmargin-right:0in;\n" +
+ "\tmargin-bottom:5.75pt;\n" +
+ "\tmargin-left:0in;\n" +
+ "\tmso-pagination:widow-orphan;\n" +
+ "\tfont-size:12.0pt;\n" +
+ "\tfont-family:\"Times New
Roman\",\"serif\";\n" +
+ "\tmso-fareast-font-family:\"Times New Roman\";}\n"
+
+ ".MsoChpDefault\n" +
+ "\t{mso-style-type:export-only;\n" +
+ "\tmso-default-props:yes;\n" +
+ "\tmso-ascii-font-family:Calibri;\n" +
+ "\tmso-ascii-theme-font:minor-latin;\n" +
+ "\tmso-fareast-font-family:Calibri;\n" +
+ "\tmso-fareast-theme-font:minor-latin;\n" +
+ "\tmso-hansi-font-family:Calibri;\n" +
+ "\tmso-hansi-theme-font:minor-latin;\n" +
+ "\tmso-bidi-font-family:\"Times New Roman\";\n" +
+ "\tmso-bidi-theme-font:minor-bidi;}\n" +
+ ".MsoPapDefault\n" +
+ "\t{mso-style-type:export-only;\n" +
+ "\tmargin-bottom:10.0pt;\n" +
+ "\tline-height:115%;}\n" +
+ "@page Section1\n" +
+ "\t{size:595.3pt 841.9pt;\n" +
+ "\tmargin:56.7pt 42.5pt 56.7pt 85.05pt;\n" +
+ "\tmso-header-margin:.5in;\n" +
+ "\tmso-footer-margin:.5in;\n" +
+ "\tmso-paper-source:0;}\n" +
+ "div.Section1\n" +
+ "\t{page:Section1;}\n" +
+ "-->\n" +
+ "</style>" +
+ "<!--[if gte mso 10]>\n" +
+ "<style>\n" +
+ " /* Style Definitions */\n" +
+ " table.MsoNormalTable\n" +
+ "\t{mso-style-name:\"?z?�N�N�???�N?
N�?�?�?�??N�?�\";\n" +
+ "\tmso-tstyle-rowband-size:0;\n" +
+ "\tmso-tstyle-colband-size:0;\n" +
+ "\tmso-style-noshow:yes;\n" +
+ "\tmso-style-priority:99;\n" +
+ "\tmso-style-qformat:yes;\n" +
+ "\tmso-style-parent:\"\";\n" +
+ "\tmso-padding-alt:0in 5.4pt 0in 5.4pt;\n" +
+ "\tmso-para-margin-top:0in;\n" +
+ "\tmso-para-margin-right:0in;\n" +
+ "\tmso-para-margin-bottom:10.0pt;\n" +
+ "\tmso-para-margin-left:0in;\n" +
+ "\tline-height:115%;\n" +
+ "\tmso-pagination:widow-orphan;\n" +
+ "\tfont-size:11.0pt;\n" +
+
"\tfont-family:\"Calibri\",\"sans-serif\";\n" +
+ "\tmso-ascii-font-family:Calibri;\n" +
+ "\tmso-ascii-theme-font:minor-latin;\n" +
+ "\tmso-fareast-font-family:\"Times New Roman\";\n" +
+ "\tmso-fareast-theme-font:minor-fareast;\n" +
+ "\tmso-hansi-font-family:Calibri;\n" +
+ "\tmso-hansi-theme-font:minor-latin;}\n" +
+ "</style>\n" +
+ "<![endif]" +
+ "-->\n" +
+ "\n" +
+ "<p align=\"center\" style=\"margin-bottom:
0.0001pt; text-align: center;\"><a name=\"OLE_LINK2\"/><a
name=\"OLE_LINK1\"><span style=\"\"><b><span
style='font-size: 20pt; font-family: \"Courier New\"; color:
black;'>We where\n" +
+ "unsuccessful in reproducting this bug in our
testing</span></b></span></a></p>\n" +
+ "\n" +
+ "<p align=\"center\" style=\"margin-bottom:
0.0001pt; text-align: center;\"><span style=\"\"><span
style=\"\"><b><span style='font-size: 20pt; font-family:
\"Courier New\"; color:
black;'>environment.</span></b></span></span></p>\n"
+
+ "\n" +
+ "<p style=\"margin-bottom: 0.0001pt;\"><span
style=\"\"><span
style=\"\"><o:p>A�</o:p></span></span></p>\n"
+
+ "\n" +
+ "<p style=\"margin-bottom: 0.0001pt;\"><span
style=\"\"><span style=\"\"><s><span
style='font-size: 13pt; font-family: \"Courier New\"; color:
black;'>Could you provide us with a example URL\n" +
+ "where this is
happening?</span></s></span></span></p>\n" +
+ "\n" +
+ "<p style=\"margin-bottom: 0.0001pt;\"><span
style=\"\"><span style=\"\"><span style='font-size:
13pt; font-family: \"Courier New\"; color: black;'>Do you have any odd
browser\n" +
+ "extensions/plugins
installed?</span></span></span></p>\n" +
+ "\n" +
+ "<p style=\"margin-bottom: 0.0001pt;\"><span
style=\"\"><span style=\"\"><span style='font-size:
13pt; font-family: \"Courier New\"; color: black;'>Does it happen on our
site aswell </span></span></span><a
href=\"http://tinymce.moxiecode.com/\"><span
style=\"\"><span style=\"\"><span style='font-size:
13pt; font-family: \"Courier
New\";'>http://tinymce.moxiecode.com</span></span></span></a><span
style=\"\"><span style=\"\"><span style='font-size:
13pt; font-family: \"Courier New\"; color:
black;'>?</span></span></span></p>\n" +
+ "\n" +
+ "<p style=\"margin-bottom: 0.0001pt;\"><span
style=\"\"><span
style=\"\"><o:p>A�</o:p></span></span></p>\n"
+
+ "\n" +
+ "<span style=\"\"/><span
style=\"\"/>\n" +
+ "\n" +
+ "<p
class=\"MsoNormal\"><o:p>A�</o:p></p>\n" +
+ "\n" +
+ "</p>";
+ assertHtml2SeamConverting(str);
+ }
+
+ public void testRF5798() throws Exception {
+ assertHtml2SeamConverting(
+ "<p style=\"margin-bottom: 0in; line-height: 100%;\"
>" +
+ " <meta http-equiv=\"CONTENT-TYPE\"
content=\"text/html;\" charset=\"utf-8\" />" +
+ " <title></title>" +
+ " <meta name=\"GENERATOR\"
content=\"OpenOffice.org 3.0 (Win32)\" />" +
+ " <style type=\"text/css\"><!--" +
+ " <!" +
+ " @page { margin: 0.79in }" +
+ " P { margin-bottom: 0.08in }" +
+ " >" +
+ " --></style>" +
+ "</p>" +
+ "<p style=\"margin-bottom: 0in; line-height:
100%;\" " +
+ " align=\"center\" " +
+ " lang=\"en-US\">" +
+ " <font color=\"#000000\">" +
+ " <font color=\"#000001\">" +
+ " <font color=\"#000002\"
style=\"font-size: 20pt;\" size=\"5\">" +
+ " <b>We where unsuccessful in reproducting
this bug in our testing</b>" +
+ " </font>" +
+ " </font>" +
+ " </font>" +
+ "</p>" +
+ "<p style=\"margin-bottom: 0in; line-height:
100%;\" " +
+ " align=\"center\" " +
+ " lang=\"en-US\">" +
+ " <font color=\"#000000\">" +
+ " <font>" +
+ " <font style=\"font-size: 20pt;\"
size=\"5\">" +
+ " <b>environment.</b>" +
+ " </font>" +
+ " </font>" +
+ " </font>" +
+ "</p>");
+// assertSeamConverting("<b>aaa _*bbb*ccc_ ddd</b>");
+ }
+
+ private String assertHtml2SeamConverting(String htmlText)
+ throws Exception {
+
+ final String seamText = convertHtmlToSeamText(htmlText);
+ System.out.println("seamText = \n" + seamText);
- assertTrue(html.contains(resultContain));
- }
+ final SeamTextParser seamParser = new SeamTextParser(
+ new SeamTextLexer(new StringReader(seamText)));
+ seamParser.startRule();
- /**
- * Method to assert converting from Seam Text to html and back
- * @param seamTextExpression
- * @throws Exception
- */
- private void assertSeamConverting(String seamTextExpression)
- throws Exception {
-
- SeamTextParser seamParser = new SeamTextParser(new SeamTextLexer(new
StringReader(seamTextExpression)));
- seamParser.startRule();
- String html = seamParser.toString();
-
- HtmlSeamTextParser htmlParser = new HtmlSeamTextParser(new HtmlSeamTextLexer(new
StringReader(html)));
- htmlParser.startRule();
- String seamtext = htmlParser.toString();
-
- assertEquals(seamTextExpression,seamtext.trim());
- }
-}
+ return seamParser.toString();
+ }
+
+ private void assertSeamConverting(String seamTextExpression) throws
TokenStreamException, RecognitionException {
+
+ final SeamTextParser seamParser = new SeamTextParser(new SeamTextLexer(new
StringReader(seamTextExpression)));
+ seamParser.startRule();
+ final String html = seamParser.toString();
+ System.out.println("html = " + html);
+
+ final String seamtext = convertHtmlToSeamText(html);
+
+ assertEquals(seamTextExpression,seamtext.trim());
+ }
+
+ private String convertHtmlToSeamText(final String html) {
+ try {
+ return HtmlToSeamSAXParser.convertHtmlToSeamText(html);
+ } catch (Exception e) {
+ e.printStackTrace();
+ assertTrue(false);
+ }
+
+ return null;
+ }
+}
\ No newline at end of file