Author: abelevich
Date: 2008-11-18 11:50:19 -0500 (Tue, 18 Nov 2008)
New Revision: 11222
Modified:
trunk/sandbox/ui/editor/src/main/antlr/html-seamtext.g
Log:
Modified: trunk/sandbox/ui/editor/src/main/antlr/html-seamtext.g
===================================================================
--- trunk/sandbox/ui/editor/src/main/antlr/html-seamtext.g 2008-11-18 15:45:18 UTC (rev
11221)
+++ trunk/sandbox/ui/editor/src/main/antlr/html-seamtext.g 2008-11-18 16:50:19 UTC (rev
11222)
@@ -302,12 +302,16 @@
}
- public boolean isPlainHMTLRequired(Token name, java.util.Stack <Token>
htmlElementStack) throws SemanticException {
+ public boolean isPlainHtmlRequired(Token name, java.util.Stack <Token>
htmlElementStack) throws SemanticException {
if(!isSeamTextElement(name)) {
return true;
}
+ if(isSimpleSeamTextElement(name)) {
+ return false;
+ }
+
if(isHeader(name) && !htmlElementStack.isEmpty()) {
return true;
}
@@ -493,7 +497,7 @@
space: s:SPACE {
if(!htmlElementStack.isEmpty()) {
Token token = htmlElementStack.pop();
- if(isPlainHMTLRequired(token, htmlElementStack)) {
+ if(isPlainHtmlRequired(token, htmlElementStack)) {
append(s.getText());
}
htmlElementStack.push(token);
@@ -562,7 +566,7 @@
preformatted = true;
}
- if(!isPlainHMTLRequired(name, htmlElementStack)) {
+ if(!isPlainHtmlRequired(name, htmlElementStack)) {
if (isFormattedHtmlSeamTextElement(name)) {
@@ -621,7 +625,7 @@
beforeBody: GT {
Token name = htmlElementStack.pop();
- if((isPlainHMTLRequired(name,htmlElementStack))) {
+ if((isPlainHtmlRequired(name,htmlElementStack))) {
append(">");
}
htmlElementStack.push(name);
@@ -650,7 +654,7 @@
value = valueCollector.toString();
}
- if(!isPlainHMTLRequired(name, htmlElementStack)) {
+ if(!isPlainHtmlRequired(name, htmlElementStack)) {
if(isFormattedHtmlSeamTextElement(name)) {
if(isLink(name)){
append(createSeamTextLink(linkHolder,value.trim()));
@@ -707,9 +711,9 @@
Token token = htmlElementStack.pop();
sanitizer.validateHtmlAttribute(token, att);
// boolean isSeamTextProcessed = isSeamTextElement(token);
- boolean isPlainHMTLRequired = isPlainHMTLRequired(token,
htmlElementStack);
+ boolean isPlainHtmlRequired = isPlainHtmlRequired(token,
htmlElementStack);
- if (isPlainHMTLRequired) {
+ if (isPlainHtmlRequired) {
append(att.getText());
append("=\"");
}
@@ -720,7 +724,7 @@
String attValue = endCapture();
sanitizer.validateHtmlAttributeValue(token, att, attValue);
- if (isPlainHMTLRequired) {
+ if (isPlainHtmlRequired) {
append(attValue);
} else if(isLink(token) && "href".equals(att.getText()))
{
@@ -729,7 +733,7 @@
}
DOUBLEQUOTE {
- if(isPlainHMTLRequired) {
+ if(isPlainHtmlRequired) {
append("\"");
}
htmlElementStack.push(token);
@@ -750,7 +754,7 @@
an:ALPHANUMERICWORD { append( an.getText() ); } |
p:PUNCTUATION { append( p.getText() ); } |
s:SLASH { append( s.getText() ); } |
- space|specialChars )*
+ space:SPACE{append(space.getText());}|specialChars )*
;
exception
catch [RecognitionException ex] {
Show replies by date