Should always trim element content when pack in.

This commit is contained in:
Heng Sin Low 2013-10-11 13:55:27 +08:00
parent a6af9e3a6f
commit f589147c87
1 changed files with 8 additions and 0 deletions

View File

@ -297,6 +297,14 @@ public class PackInHandler extends DefaultHandler {
setupHandlers();
} else {
Element e = stack.pop();
if (e.contents != null && e.contents.length() > 0)
{
if (e.contents.toString().length() != e.contents.toString().trim().length())
{
String s = e.contents.toString().trim();
e.contents = new StringBuffer(s);
}
}
if (stack.isEmpty())
{
try {