Author: andreas
Date: Fri Jul 11 05:53:25 2008
New Revision: 675939
URL: http://svn.apache.org/viewvc?rev=675939&view=rev
Log:
Use line breaks instead of <div> elements for diff formatting.
Modified:
lenya/docu/modules/diff/java/src/org/apache/lenya/modules/diff/lcs/SaxHandler.java
Modified: lenya/docu/modules/diff/java/src/org/apache/lenya/modules/diff/lcs/SaxHandler.java
URL: http://svn.apache.org/viewvc/lenya/docu/modules/diff/java/src/org/apache/lenya/modules/diff/lcs/SaxHandler.java?rev=675939&r1=675938&r2=675939&view=diff
==============================================================================
--- lenya/docu/modules/diff/java/src/org/apache/lenya/modules/diff/lcs/SaxHandler.java (original)
+++ lenya/docu/modules/diff/java/src/org/apache/lenya/modules/diff/lcs/SaxHandler.java Fri Jul 11 05:53:25 2008
@@ -10,6 +10,7 @@
protected static final String ATTR_CLASS = "class";
protected static final String ELEM_SPAN = "span";
protected static final String ELEM_DIV = "div";
+ protected static final String ELEM_BR = "br";
public static final String ADDED = "added";
public static final String REMOVED = "removed";
@@ -26,7 +27,7 @@
public void element(Object obj) throws Exception {
if (obj instanceof StartTagStart) {
- startElement(ELEM_DIV);
+ lineBreak();
StartTagStart startTag = (StartTagStart) obj;
characters("<" + startTag.getLocalName());
this.handlingText = false;
@@ -39,7 +40,7 @@
else if (obj instanceof EndTag) {
EndTag endTag = (EndTag) obj;
characters("</" + endTag.getLocalName() + ">");
- endElement(ELEM_DIV);
+ lineBreak();
this.handlingText = false;
}
else if (obj instanceof AttributeName) {
@@ -57,6 +58,11 @@
this.handlingText = true;
}
}
+
+ protected void lineBreak() throws Exception {
+ startElement(ELEM_BR);
+ endElement(ELEM_BR);
+ }
protected void closeAttribute() throws Exception {
if (this.handlingAttr) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.