[jboss-cvs] jboss-seam ...
Christian Bauer
christian at hibernate.org
Fri Jan 11 12:53:22 EST 2008
User: cbauer
Date: 08/01/11 12:53:22
Modified: jboss-seam seam-text.g
Log:
Customizable headlines, required for id rendering
Revision Changes Path
1.46 +31 -15 jboss-seam/seam-text.g
(In the diff below, changes in quantity of whitespace are not shown.)
Index: seam-text.g
===================================================================
RCS file: /cvsroot/jboss/jboss-seam/seam-text.g,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- seam-text.g 30 Dec 2007 02:26:51 -0000 1.45
+++ seam-text.g 11 Jan 2008 17:53:22 -0000 1.46
@@ -11,7 +11,7 @@
}
{
private java.util.Set htmlElements = new java.util.HashSet( java.util.Arrays.asList( new String[] { "a", "p", "q", "blockquote", "code", "pre", "table", "tr", "td", "th", "ul", "ol", "li", "b", "i", "u", "tt", "del", "em", "hr", "br", "div", "span", "h1", "h2", "h3", "h4", "img"} ) );
- private java.util.Set htmlAttributes = new java.util.HashSet( java.util.Arrays.asList( new String[] { "src", "href", "lang", "class", "id", "style", "width", "height", "name", "value", "type" } ) );
+ private java.util.Set htmlAttributes = new java.util.HashSet( java.util.Arrays.asList( new String[] { "src", "href", "lang", "class", "id", "style", "width", "height", "name", "value", "type", "cellpadding", "cellspacing", "border" } ) );
public class Macro {
public String name;
@@ -85,20 +85,20 @@
return "<blockquote class=\"seamTextBlockquote\">\n";
}
- protected String headline1OpenTag() {
- return "<h1 class=\"seamTextHeadline1\">";
+ protected String headline1(String line) {
+ return "<h1 class=\"seamTextHeadline1\">" + line + "</h1>";
}
- protected String headline2OpenTag() {
- return "<h2 class=\"seamTextHeadline2\">";
+ protected String headline2(String line) {
+ return "<h2 class=\"seamTextHeadline2\">" + line + "</h2>";
}
- protected String headline3OpenTag() {
- return "<h3 class=\"seamTextHeadline3\">";
+ protected String headline3(String line) {
+ return "<h3 class=\"seamTextHeadline3\">" + line + "</h3>";
}
- protected String headline4OpenTag() {
- return "<h4 class=\"seamTextHeadline4\">";
+ protected String headline4(String line) {
+ return "<h4 class=\"seamTextHeadline4\">" + line + "</h4>";
}
protected String orderedListOpenTag() {
@@ -284,16 +284,32 @@
heading: ( h1 | h2 | h3 | h4 ) newlineOrEof
;
-h1: PLUS { append( headline1OpenTag() ); } line { append("</h1>"); }
+h1: PLUS
+ { beginCapture(); }
+ line
+ { String headline=endCapture(); }
+ { append(headline1(headline.trim())); }
;
-h2: PLUS PLUS { append( headline2OpenTag() ); } line { append("</h2>"); }
+h2: PLUS PLUS
+ { beginCapture(); }
+ line
+ { String headline=endCapture(); }
+ { append(headline2(headline.trim())); }
;
-h3: PLUS PLUS PLUS { append( headline3OpenTag() ); } line { append("</h3>"); }
+h3: PLUS PLUS PLUS
+ { beginCapture(); }
+ line
+ { String headline=endCapture(); }
+ { append(headline3(headline.trim())); }
;
-h4: PLUS PLUS PLUS PLUS { append( headline4OpenTag() ); } line { append("</h4>"); }
+h4: PLUS PLUS PLUS PLUS
+ { beginCapture(); }
+ line
+ { String headline=endCapture(); }
+ { append(headline4(headline.trim())); }
;
list: ( olist | ulist ) newlineOrEof
More information about the jboss-cvs-commits
mailing list