View Full Version : the influence of space

Feb 22nd, 2012, 05:34 AM
This is second time I encountered this space effect.

What you see here is done server side twice, all exact same thing with only exception:

out.print(" ...</a></li> ");
out.print(" ...</a></li>");

You see extra space at first line ? Without that space all gets wrong !

Result: Se last line on this html page: http://agrozoo.net/jsp/taxon-clouds/gobe.jsp, it contains all exact same thing
as all stuff above, except that space, mentioned in uppercode is missing.

Any comment abut that ?

So I looked up some of my code that basicaly compresses html,on the end of it I have:

s = s.replaceAll("</a>","</a> ");

which a bit decompress the thing otherwise the display is broken.
So I guess I should allso add:

s = s.replaceAll("</li>","</li> ");

Is there more general rule about that ?

Feb 22nd, 2012, 06:04 AM
You may want to ask this in the Java and JSP section...people that know your answer hang in that section

Feb 22nd, 2012, 10:36 AM
Usually in HTML there should be no difference. I can only imagine that there’s a hidden character like a non-breaking space that prevents the elements from wrapping.