Author: Alex.Kolonitsky
Date: 2009-03-31 08:26:11 -0400 (Tue, 31 Mar 2009)
New Revision: 13315
Added:
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/FormattingTag.java
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/HtmlTag.java
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/LineTag.java
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/LinkTag.java
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/OrderedListTag.java
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/TagFactory.java
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/UnorderedListTag.java
Removed:
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/Tag.java
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/TagFactory.java
Modified:
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/DefaultSeamTextConverter.java
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/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java
Log:
Editor: converter error if use nesting formatting.
https://jira.jboss.org/jira/browse/RF-5790
Editor: convertion failed in case past formatted text in editor.
https://jira.jboss.org/jira/browse/RF-5825
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-31
12:06:53 UTC (rev 13314)
+++
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/DefaultSeamTextConverter.java 2009-03-31
12:26:11 UTC (rev 13315)
@@ -59,7 +59,7 @@
}
try {
- return HtmlToSeamSAXParser.convertHtmlToSeamText(value);
+ return new HtmlToSeamSAXParser().convertHtmlToSeamText(value);
} catch (Exception e) {
FacesMessage message = new FacesMessage(
Modified:
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamSAXParser.java
===================================================================
---
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamSAXParser.java 2009-03-31
12:06:53 UTC (rev 13314)
+++
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamSAXParser.java 2009-03-31
12:26:11 UTC (rev 13315)
@@ -2,13 +2,15 @@
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.richfaces.convert.seamtext.tags.HtmlTag;
+import org.richfaces.convert.seamtext.tags.TagFactory;
import org.xml.sax.Attributes;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
import org.xml.sax.helpers.DefaultHandler;
+import org.xml.sax.helpers.XMLReaderFactory;
import java.io.IOException;
import java.io.StringReader;
@@ -25,24 +27,28 @@
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);
-
+ public final HtmlTag rootTag = TAG_FACTORY.getInstance(ROOT_TAG_NAME);
+
+ public HtmlTag getRootTag() {
+ return rootTag;
+ }
+
private SeamTextParser.Sanitizer sanitizer = new SeamTextParser.DefaultSanitizer();
private HtmlToSeamTransformer transformer;
- private Stack<Tag> tagStack;
+ private Stack<HtmlTag> tagStack;
public HtmlToSeamSAXParser() {
- tagStack = new Stack<Tag>();
+ tagStack = new Stack<HtmlTag>();
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);
+ final HtmlToSeamSAXParser parser = new HtmlToSeamSAXParser();
+ final XMLReader p = XMLReaderFactory.createXMLReader();
+ p.setContentHandler(parser);
try {
p.setFeature("http://xml.org/sax/features/namespaces", false);
p.setFeature("http://xml.org/sax/features/namespace-prefixes",
false);
@@ -54,7 +60,7 @@
p.parse(new InputSource(new StringReader(str.toString())));
- return t.getTransformer().toString();
+ return parser.getRootTag().toString();
}
@Override
@@ -64,14 +70,15 @@
}
if (ROOT_TAG_NAME.equalsIgnoreCase(qName)) {
- tagStack.push(ROOT_TAG);
+ tagStack.push(rootTag);
+ transformer.setCurrentTag(rootTag);
} 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
+ final HtmlTag 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 {
@@ -85,7 +92,7 @@
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))) {
+ if (isValidAttr(tag, attributes.getQName(i), attributes.getValue(i))) {
map.put(attributes.getQName(i), attributes.getValue(i));
}
}
@@ -95,7 +102,7 @@
@Override
public void endElement(String uri, String localName, String qName) {
- final Tag tag;
+ final HtmlTag tag;
if (ROOT_TAG_NAME.equalsIgnoreCase(qName)) {
tag = tagStack.pop();
@@ -170,9 +177,12 @@
}
}
- private boolean isValidAttr(String tag, String name) {
+ private boolean isValidAttr(String tag, String name, String value) {
try {
- sanitizer.validateHtmlAttribute(new FakeToken(0, tag), new FakeToken(0,
name));
+ final FakeToken tagToken = new FakeToken(0, tag);
+ final FakeToken attrToken = new FakeToken(0, name);
+ sanitizer.validateHtmlAttribute(tagToken, attrToken);
+ sanitizer.validateHtmlAttributeValue(tagToken, attrToken, value);
} catch (SemanticException e) {
return false;
}
@@ -188,14 +198,14 @@
return true;
}
- private boolean isValidTag(Tag tag) {
+ private boolean isValidTag(HtmlTag tag) {
return isValidTag(tag.getName());
}
/*
* Handling invalid tags by sanitizer
* */
- private Tag firstInvalidTag = null;
+ private HtmlTag firstInvalidTag = null;
private boolean hasInvalidParentTag() {
return firstInvalidTag != null;
@@ -205,11 +215,11 @@
this.firstInvalidTag = null;
}
- private void setFirstInvalidTag(Tag firstInvalidTag) {
+ private void setFirstInvalidTag(HtmlTag firstInvalidTag) {
this.firstInvalidTag = firstInvalidTag;
}
- private Tag getFirstInvalidTag() {
+ private HtmlTag getFirstInvalidTag() {
return this.firstInvalidTag;
}
Modified:
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java
===================================================================
---
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java 2009-03-31
12:06:53 UTC (rev 13314)
+++
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/HtmlToSeamTransformer.java 2009-03-31
12:26:11 UTC (rev 13315)
@@ -5,92 +5,22 @@
import java.util.HashSet;
import java.util.Stack;
+import org.richfaces.convert.seamtext.tags.HtmlTag;
+
+import static org.richfaces.convert.seamtext.tags.HtmlTag.*;
+
/**
* @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));
+ DEL, SUP, PRE, Q, I, TT, 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));
+ H1, H2, H3, H4, P, UL, OL, LI, A, 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());
@@ -99,83 +29,63 @@
HTML_SEAM_TEXT_ELEMENTS.addAll(FORMATTED_HTML_SEAM_TEXT_ELEMENTS);
}
- private Stack<Tag> htmlElementStack = new Stack<Tag>();
+ private Stack<HtmlTag> htmlElementStack = new Stack<HtmlTag>();
- public Stack<Tag> getHtmlElementStack() {
- return htmlElementStack;
- }
+ private StringBuilder newLinesCollector;
+
+ private HtmlTag currentTag = null;
- 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 Stack<HtmlTag> getHtmlElementStack() {
+ return htmlElementStack;
+ }
- public StringBuilder newLinesCollector;
+ public void setHtmlElementStack(Stack<HtmlTag> htmlElementStack) {
+ this.htmlElementStack = htmlElementStack;
+ }
- @Override
- public String toString() {
- return builder.toString();
+ private void appendStart(HtmlTag tag) {
+ currentTag.appendBody(tag);
+ currentTag = tag;
}
- private void append(String ... strings) {
+ private void appendBody(String ... strings) {
for (String str : strings) {
- builder.append(str);
+ currentTag.appendBody(str);
}
}
-
- public boolean isLink(Tag tag) {
- return HTML_A.equalsIgnoreCase(tag.getName());
+
+ private void appendEnd() {
+ currentTag = htmlElementStack.peek();
}
+
+ public String escapeSeamText(String tokenName, boolean preformatted) {
+ final StringBuilder result = new StringBuilder(tokenName.length() + 1);
+ if (!preformatted) {
+ result.append('\\');
+ }
+ result.append(tokenName);
- 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);
+ return result.toString();
}
- public boolean isParagraph(Tag tag) {
- return HTML_P.equalsIgnoreCase(tag.getName());
+ public boolean isSeamTextElement(HtmlTag element) {
+ return HTML_SEAM_TEXT_ELEMENTS.contains(element.getName().toLowerCase());
}
- public boolean isList(Tag token) {
- final String name = token.getName().toLowerCase();
- return HTML_UL.equals(name) || HTML_OL.equals(name);
+ public boolean isSimpleSeamTextElement(HtmlTag element) {
+ return SIMPLE_HTML_SEAM_TEXT_ELEMENTS.contains(element.getName().toLowerCase());
}
- public boolean isListItem(Tag token) {
- final String name = token.getName().toLowerCase();
- return HTML_LI.equals(name);
+ public boolean isFormattedHtmlSeamTextElement(HtmlTag element) {
+ return
FORMATTED_HTML_SEAM_TEXT_ELEMENTS.contains(element.getName().toLowerCase());
}
- public boolean isPreFormattedElement(Tag tag) {
- final String name = tag.getName().toLowerCase();
- return HTML_PRE.equals(name) || HTML_TT.equals(name);
- }
+ public boolean isPlainHtmlRequired(HtmlTag 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;
}
@@ -184,11 +94,9 @@
return false;
}
- if (!HTML_A.equals(name.getName().toLowerCase())
- && !HTML_P.equals(name.getName().toLowerCase())) {
-
- for (Tag token : htmlElementStack) {
- if (isHeader(token) || isListItem(token)) {
+ if (!name.isLink() && !name.isParagraph()) {
+ for (HtmlTag token : htmlElementStack) {
+ if (token.isHeader() || token.isListItem()) {
return true;
}
}
@@ -196,85 +104,7 @@
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());
@@ -298,8 +128,8 @@
}
private void setHeaderProcessed() {
- final Tag token = htmlElementStack.peek();
- if (!isParagraph(token) && isHeaderProcessed) {
+ final HtmlTag token = htmlElementStack.peek();
+ if (!token.isParagraph() && isHeaderProcessed) {
isHeaderProcessed = false;
}
}
@@ -314,11 +144,11 @@
break;
case '\n':
- final Tag token = htmlElementStack.peek();
- if (!(isParagraph(token)
+ final HtmlTag token = htmlElementStack.peek();
+ if (!(token.isParagraph()
|| isHeaderProcessed
|| HtmlToSeamSAXParser.ROOT_TAG_NAME.equals(token.getName())
- || isList(token))) {
+ || token.isList())) {
out(text, start, localLength);
}
@@ -330,7 +160,7 @@
}
public void seamCharacters(char[] text, int start, int length) {
- append(escapeSeamText(new String(text, start, length), preformatted));
+ appendBody(escapeSeamText(new String(text, start, length), preformatted));
}
public void plain(char[] text, int start, int length) {
@@ -340,12 +170,12 @@
}
public void out(char[] text, int start, int length) {
- append(new String(text, start, length));
+ appendBody(new String(text, start, length));
}
public void space(char[] text, int start, int length) {
if (!htmlElementStack.isEmpty()) {
- final Tag token = htmlElementStack.peek();
+ final HtmlTag token = htmlElementStack.peek();
if (isPlainHtmlRequired(token)) {
out(text, start, length);
}
@@ -358,34 +188,20 @@
}
}
- public void openTag(Tag tag) {
-
- if (isPreFormattedElement(tag)) {
+ public void openTag(HtmlTag tag) {
+
+ if (tag.isPreFormattedElement()) {
preformatted = true;
}
if (isPlainHtmlRequired(tag)) {
outValueCollector();
- append(tag.printPlainStart());
+ appendStart(tag);
} 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)) {
-
+ if (!isFormattedHtmlSeamTextElement(tag)) {
outValueCollector();
- append(getSimpleSeamText(tag));
- } else {
- throw new IllegalStateException("Unknow situation. ");
- }
+ }
+ appendStart(tag);
}
isFirstChars = true;
@@ -393,12 +209,12 @@
private void outValueCollector() {
if (newLinesCollector != null) {
- append(newLinesCollector.toString());
+ appendBody(newLinesCollector.toString());
newLinesCollector = null;
}
}
- public void closeTagWithBody(Tag tag) {
+ public void closeTagWithBody(HtmlTag tag) {
if (!tag.getName().equals(tag.getName())) {
throw new IllegalStateException("Can not convert to the Seam Text:
</" + tag.getName() + "> expected");
}
@@ -408,42 +224,29 @@
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. ");
- }
+ if (tag.isLink()) {
+ value = "";
+ } else if (tag.isParagraph()) {
+ isHeaderProcessed = false;
+ } else if (tag.isHeader()) {
+ isHeaderProcessed = true;
}
+
+ appendBody(value);
+ appendEnd();
-
newLinesCollector = null;
- if (isPreFormattedElement(tag)) {
+ if (tag.isPreFormattedElement()) {
preformatted = false;
}
}
+
+ public HtmlTag getCurrentTag() {
+ return currentTag;
+ }
+
+ public void setCurrentTag(HtmlTag currentTag) {
+ this.currentTag = currentTag;
+ }
}
Deleted: trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/Tag.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/Tag.java 2009-03-31
12:06:53 UTC (rev 13314)
+++ trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/Tag.java 2009-03-31
12:26:11 UTC (rev 13315)
@@ -1,106 +0,0 @@
-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();
- }
-}
Deleted: trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/TagFactory.java
===================================================================
---
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/TagFactory.java 2009-03-31
12:06:53 UTC (rev 13314)
+++
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/TagFactory.java 2009-03-31
12:26:11 UTC (rev 13315)
@@ -1,89 +0,0 @@
-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;
- }
-}
Added:
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/FormattingTag.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/FormattingTag.java
(rev 0)
+++
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/FormattingTag.java 2009-03-31
12:26:11 UTC (rev 13315)
@@ -0,0 +1,71 @@
+package org.richfaces.convert.seamtext.tags;
+
+class FormattingTag extends HtmlTag {
+ private static final long serialVersionUID = 2688496380368279023L;
+
+ private String seamTag;
+ private Boolean formating;
+
+ public FormattingTag(String tagName, String seamTag) {
+ super(tagName);
+ this.seamTag = seamTag;
+ }
+
+ @Override
+ public void appendBody(HtmlTag tag) {
+ super.appendBody(tag);
+
+ if (!(tag instanceof FormattingTag)) {
+ formating = false;
+ }
+ }
+
+ @Override
+ public String print() {
+ if (isFormating()) {
+ return super.print();
+ }
+
+ return printPlain();
+ }
+
+ @Override
+ public String printEnd() {
+ return seamTag;
+ }
+
+ @Override
+ public String printStart() {
+ return seamTag;
+ }
+
+ public boolean isFormating() {
+ if (formating != null) {
+ return formating;
+ }
+
+ for (Object child : body) {
+ if (child instanceof FormattingTag) {
+ FormattingTag formattingChild = (FormattingTag) child;
+ if (!formattingChild.isFormating()) {
+ formating = false;
+ return false;
+ }
+ } else if (child instanceof HtmlTag) {
+ throw new IllegalStateException(
+ "It is imposible, in this case we must have formating =
false");
+ }
+ }
+
+ formating = true;
+ return true;
+ }
+
+ public String getSeamTag() {
+ return seamTag;
+ }
+
+ public void setSeamTag(String seamTag) {
+ this.seamTag = seamTag;
+ }
+}
Copied: trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/HtmlTag.java
(from rev 13275, trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/Tag.java)
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/HtmlTag.java
(rev 0)
+++
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/HtmlTag.java 2009-03-31
12:26:11 UTC (rev 13315)
@@ -0,0 +1,225 @@
+package org.richfaces.convert.seamtext.tags;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @user: akolonitsky
+ * Date: Mar 24, 2009
+ *
+ * TODO Rename to HtmlTag
+ */
+public class HtmlTag implements Cloneable, Serializable{
+
+ private static final long serialVersionUID = -372761460000118889L;
+
+ public static final String A = "a";
+ public static final String H1 = "h1";
+ public static final String H2 = "h2";
+ public static final String H3 = "h3";
+ public static final String H4 = "h4";
+ public static final String P = "p";
+ public static final String UL = "ul";
+ public static final String OL = "ol";
+ public static final String LI = "li";
+ public static final String PRE = "pre";
+ public static final String TT = "tt";
+ public static final String DEL = "del";
+ public static final String SUP = "sup";
+ public static final String Q = "q";
+ public static final String I = "i";
+ public static final String U = "u";
+ public static final String BLOCKQOUTE = "blockqoute";
+
+ private String name;
+ private Map<String, String> attributes;
+
+ protected List<Object> body;
+
+ private boolean isEmpty = true;
+
+ HtmlTag() {
+ cleanBody();
+ }
+
+ HtmlTag(String name) {
+ this();
+
+ setName(name);
+ }
+
+ HtmlTag(String name, Map<String, String> attributes) {
+ this();
+
+ 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(prepareValue(pair.getValue())).append("\"
");
+ }
+ return builder.substring(0, builder.length() - 1);
+ }
+
+ private String prepareValue(String value) {
+ return value.replace('"', '^');
+ }
+
+ protected void appendChildTag(StringBuilder res, HtmlTag child) {
+ res.append(child);
+ }
+
+ public String printBody() {
+ final StringBuilder res = new StringBuilder();
+ for (Object child : body) {
+ if (child instanceof HtmlTag) {
+ appendChildTag(res, (HtmlTag)child);
+ } else {
+ res.append(child);
+ }
+ }
+ return res.toString();
+ }
+
+ public void appendBody(HtmlTag tag) {
+ body.add(tag);
+ }
+
+ public void appendBody(String str) {
+ body.add(str);
+ }
+
+ public void cleanBody() {
+ body = new ArrayList<Object>();
+ }
+
+ public String printPlainEnd(){
+ if (isEmpty) {
+// return "/>";
+ }
+
+ final StringBuilder builder = new StringBuilder(getName().length() + 3);
+ builder.append("</").append(getName()).append('>');
+
+ return builder.toString();
+ }
+
+ public String printEnd(){
+ return printPlainEnd();
+ }
+
+ public boolean isLink() {
+ return A.equals(name);
+ }
+
+ public boolean isHeader() {
+ return H1.equals(name) || H2.equals(name) || H3.equals(name) || H4.equals(name);
+ }
+
+ public boolean isParagraph() {
+ return P.equals(name);
+ }
+
+ public boolean isList() {
+ return UL.equals(name) || OL.equals(name);
+ }
+
+ public boolean isListItem() {
+ return LI.equals(name);
+ }
+
+ public boolean isPreFormattedElement() {
+ return PRE.equals(name) || TT.equals(name);
+ }
+
+ public void setEmpty() {
+ isEmpty = true;
+ }
+
+ public void setNotEmpty() {
+ isEmpty = false;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name.toLowerCase();
+ }
+
+ 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 print();
+ }
+
+ public String print() {
+ return printStart() + printBody() + printEnd();
+ }
+
+ public String printPlain() {
+ return printPlainStart() + printBody() + printPlainEnd();
+ }
+
+ protected HtmlTag cloneTag() {
+ HtmlTag clone;
+ try {
+ clone = (HtmlTag) this.clone();
+ } catch (CloneNotSupportedException e) {
+ e.printStackTrace();
+ return null;
+ }
+
+ clone.name = this.name;
+ clone.cleanBody();
+
+ return clone;
+ }
+
+ @Override
+ protected Object clone() throws CloneNotSupportedException {
+ return super.clone();
+ }
+
+}
Added: trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/LineTag.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/LineTag.java
(rev 0)
+++
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/LineTag.java 2009-03-31
12:26:11 UTC (rev 13315)
@@ -0,0 +1,40 @@
+package org.richfaces.convert.seamtext.tags;
+
+class LineTag extends HtmlTag {
+ private static final long serialVersionUID = 6972613670825989225L;
+
+ private String startTag;
+
+ public LineTag(String name, String startTag) {
+ super(name);
+ setStartTag(startTag);
+ }
+
+ @Override
+ public String printStart() {
+ return startTag;
+ }
+
+ @Override
+ protected void appendChildTag(StringBuilder res, HtmlTag child) {
+ if (child instanceof LineTag) {
+ res.append(((LineTag)child).printPlain());
+ } else {
+ res.append(child);
+ }
+ }
+
+ @Override
+ public String printEnd() {
+ return "\n";
+ }
+
+ public String getStartTag() {
+ return startTag;
+ }
+
+ public void setStartTag(String startTag) {
+ this.startTag = startTag;
+ }
+}
+
Added: trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/LinkTag.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/LinkTag.java
(rev 0)
+++
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/LinkTag.java 2009-03-31
12:26:11 UTC (rev 13315)
@@ -0,0 +1,46 @@
+package org.richfaces.convert.seamtext.tags;
+
+class LinkTag extends HtmlTag {
+
+ private static final long serialVersionUID = -6944275891941825069L;
+ private Boolean haveHtml = false;
+
+ public LinkTag() {
+ super(A);
+ }
+
+ @Override
+ public void appendBody(HtmlTag tag) {
+ super.appendBody(tag);
+
+ haveHtml = true;
+ }
+
+ @Override
+ public String print() {
+ if (haveHtml) {
+ return printPlain();
+ }
+
+ return super.print();
+ }
+
+ @Override
+ public String printStart() {
+ return "[";
+ }
+
+ @Override
+ public String printEnd() {
+ String s = getAttribute("href");
+ if (s == null) {
+ s = "/";
+ }
+ return "=>"+ s + ']';
+ }
+
+ @Override
+ public String printStartSuffix() {
+ return "";
+ }
+}
Added:
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/OrderedListTag.java
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/OrderedListTag.java
(rev 0)
+++
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/OrderedListTag.java 2009-03-31
12:26:11 UTC (rev 13315)
@@ -0,0 +1,28 @@
+package org.richfaces.convert.seamtext.tags;
+
+class OrderedListTag extends HtmlTag {
+ private static final long serialVersionUID = 1L;
+
+ public OrderedListTag() {
+ super(OL);
+ }
+
+ @Override
+ public String printStart() {
+ return "";
+ }
+
+ @Override
+ public String printEnd() {
+ return "\n";
+ }
+
+ @Override
+ protected void appendChildTag(StringBuilder res, HtmlTag child) {
+ if (LI.equals(child.getName())) {
+ res.append(TagFactory.SEAM_HASH).append(child.print());
+ } else {
+ res.append(child);
+ }
+ }
+}
Copied: trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/TagFactory.java
(from rev 13275,
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/TagFactory.java)
===================================================================
--- trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/TagFactory.java
(rev 0)
+++
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/TagFactory.java 2009-03-31
12:26:11 UTC (rev 13315)
@@ -0,0 +1,103 @@
+package org.richfaces.convert.seamtext.tags;
+
+import static org.richfaces.convert.seamtext.tags.HtmlTag.*;
+
+import java.util.*;
+
+
+/**
+ * @user: akolonitsky
+ * Date: Mar 25, 2009
+ */
+public class TagFactory {
+
+ public static final String SEAM_PLUS = "+";
+ public static final String SEAM_MONOSPACE = "|";
+ public static final String SEAM_TWIDDLE = "~";
+ public static final String SEAM_HASH = "#";
+ public static final String SEAM_HAT = "^";
+ public static final String SEAM_STAR = "*";
+ public static final String SEAM_UNDERSCORE = "_";
+ public static final String SEAM_EQ = "=";
+ public static final String SEAM_BACKTICK = "`";
+ public static final String SEAM_DOUBLEQUOTE = "\"";
+ public static final String SEAM_LINK_START = "[";
+ public static final String SEAM_LINK_END = "]";
+
+ /**
+ * Collection of special Seam Tags
+ * */
+ private static final Collection<HtmlTag> TAGS = Arrays.asList(
+ getNewTagDefinition("root", "", ""),
+ new LineTag(H1, "+ "),
+ new LineTag(H2, "++ "),
+ new LineTag(H3, "+++ "),
+ new LineTag(H4, "++++ "),
+ new LineTag(LI, ""),
+ getNewTagDefinition(P, "", "\n\n"),
+
+ new FormattingTag(I, SEAM_STAR),
+ new FormattingTag(DEL, SEAM_TWIDDLE),
+ new FormattingTag(SUP, SEAM_HAT),
+ new FormattingTag(U, SEAM_UNDERSCORE),
+ new FormattingTag(TT, SEAM_MONOSPACE){
+
+ @Override
+ public boolean isFormating() {
+ return true;
+ }
+ },
+
+ getNewTagDefinition(PRE, SEAM_BACKTICK, SEAM_BACKTICK),
+ getNewTagDefinition(Q, SEAM_DOUBLEQUOTE, SEAM_DOUBLEQUOTE),
+
+ new LinkTag(),
+ new UnorderedListTag(),
+ new OrderedListTag()
+ );
+
+ private static final Map<String, HtmlTag> TAGS_MAP = new HashMap<String,
HtmlTag>(TAGS.size());
+ static {
+ for (HtmlTag tag : TAGS) {
+ TAGS_MAP.put(tag.getName(), tag);
+ }
+ }
+
+ /**
+ * Create subclass for Tag class with overrided printStart, printEnd methods
+ * */
+ private static HtmlTag getNewTagDefinition(final String tagName, final String
startTag, final String endTag) {
+ return new HtmlTag(tagName) {
+ @Override
+ public String printStart() {
+ return startTag;
+ }
+
+ @Override
+ public String printEnd() {
+ return endTag;
+ }
+
+ @Override
+ public String printStartSuffix() {
+ return "";
+ }
+ };
+ }
+
+ public HtmlTag getInstance(String tagName) {
+ return getInstance(tagName, null);
+ }
+
+ public HtmlTag getInstance(String tagName, Map<String, String> attr) {
+ HtmlTag tag = TAGS_MAP.get(tagName);
+ if (tag == null) {
+ tag = new HtmlTag(tagName);
+ } else {
+ tag = tag.cloneTag();
+ }
+ tag.setAttributes(attr);
+
+ return tag;
+ }
+}
Added:
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/UnorderedListTag.java
===================================================================
---
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/UnorderedListTag.java
(rev 0)
+++
trunk/ui/editor/src/main/java/org/richfaces/convert/seamtext/tags/UnorderedListTag.java 2009-03-31
12:26:11 UTC (rev 13315)
@@ -0,0 +1,28 @@
+package org.richfaces.convert.seamtext.tags;
+
+class UnorderedListTag extends HtmlTag{
+ private static final long serialVersionUID = 1L;
+
+ public UnorderedListTag() {
+ super(UL);
+ }
+
+ @Override
+ public String printStart() {
+ return "";
+ }
+
+ @Override
+ public String printEnd() {
+ return "\n";
+ }
+
+ @Override
+ protected void appendChildTag(StringBuilder res, HtmlTag child) {
+ if (LI.equals(child.getName())) {
+ res.append(TagFactory.SEAM_EQ).append(child.print());
+ } else {
+ res.append(child);
+ }
+ }
+}
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-31
12:06:53 UTC (rev 13314)
+++
trunk/ui/editor/src/test/java/org/richfaces/seamparser/HtmlSeamParserTest.java 2009-03-31
12:26:11 UTC (rev 13315)
@@ -16,7 +16,7 @@
public class HtmlSeamParserTest extends TestCase {
- private final static String SEAM_TEXT_EXPRESSION_1 = "It's easy to make
*emphasis*, |monospace|, "
+ private final static String SEAM_TEXT_EXPRESSION_1 = "It's easy to make
*emphasis* -1- *emphasis*, |monospace|, "
+ "~deleted text~, super^scripts^ or_underlines_.";
private final static String SEAM_TEXT_EXPRESSION_2 = "+ This is a big
heading\n"
@@ -102,9 +102,6 @@
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/>";
-
-
public HtmlSeamParserTest(String name) {
super(name);
}
@@ -226,27 +223,23 @@
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 {
+ public void testNestingFormating() 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 testNestingFormating1() throws Exception {
+ assertHtml2SeamConverting("<P><STRONG>aaaaaaaaad
<U><B>ddddddddddddd</B>
sssssssssssss</U></STRONG></P>");
+ }
- public void testRF5798_() throws Exception {
+ public void testSkipComment() throws Exception {
assertHtml2SeamConverting("<!-- Hello Cfif -->");
}
- public void noTestRF5798__() throws Exception {
+ public void testUglyTextFromWord() 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" +
@@ -691,7 +684,7 @@
assertHtml2SeamConverting(str);
}
- public void testRF5798() throws Exception {
+ public void testTextFromOpenOffice() throws Exception {
assertHtml2SeamConverting(
"<p style=\"margin-bottom: 0in; line-height: 100%;\"
>" +
" <meta http-equiv=\"CONTENT-TYPE\"
content=\"text/html;\" charset=\"utf-8\" />" +
@@ -726,7 +719,6 @@
" </font>" +
" </font>" +
"</p>");
-// assertSeamConverting("<b>aaa _*bbb*ccc_ ddd</b>");
}
private String assertHtml2SeamConverting(String htmlText)