Bugs item #2807114, was opened at 2009-06-16 13:30
Message generated for change (Tracker Item Submitted) made by rkrzewsk
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=116035&aid=2807114&group_id=16035

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Rafal Krzewski (rkrzewsk)
Assigned to: Nobody/Anonymous (nobody)
Summary: HTMLWriter removes too much whitespace

Initial Comment:
consider the following DOM tree
Element P
+Text "aaa "
+Element U
 | +Text "bbb "
+Text "ccc"

I'd expect it would be prettyprinted as <P>aaa <U>bbb </U>ccc</P>. However, the 
way HTMLWriter is implemented it is prettyprinted as <P>aaa<U>bbb</U>ccc</P>. 
When displayed in the browser the text is run together.

IMO the problem is in HTMLWriter.writeText(String) method (line 298 as of 
revision 1.21).  super.writeString(text.trim()); is called when in fact, the 
whitespace should either be left alone (trimText == false) or leading and 
trailing whitespace (if present) should be normalized into single space 
characters.

I can't see any way around that by flipping configuration switches, but if 
there is one I'd be happy to hear it.
Otherwise, I'd be happy to take a swing at fixing that and provide a patch.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=116035&aid=2807114&group_id=16035

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
dom4j-dev mailing list
dom4j-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-dev

Reply via email to