Ok, this is gonna be longwinded and boring to most of you
out there I reccon (and sorry Duke if you know this already, just ignore it in
that case):
This is an HTML thing which affects all browsers - not just
for xwiki, but any web application under normal circumstances, for text rendered
by the browser.
Why this happens is fairly simple (ok, dusty memory
but here's a stab at it). Generally speaking, any spaces (and characters
that result in "space" such as line breaks, tabs, etc); are regarded as
"whitespace" in html. Whitespace is ignored when there is more than
one single whitespace character - so you could add a bunch of tabs, spaces,
linebreaks, etc between a word, and it will be regarded as one single
space.
Putting in specific codes tells the HTML engine what you're
wanting to do. For example:
Line1 Line2 will become Line1
Line2
-But-
Line1 Line2 will
become Line1 Line2 ( is the code for
non-breaking-space)
As the text is rendered by the browser, there is not much
you can do to change it
I guess one could wrap text into a non-HTML rendering
object perhaps, like a textarea - but note that anything you do to change
this, affects rendering of the page; and could unexpectedly break flexibility
elsewhere
From: Duke Tantiprasut
[mailto:duketantiprasut@gmail.com]
Sent: 27 July 2006
15:58
To: xwiki-users@objectweb.org
Subject: [xwiki-users]
line breaks
Hi All,
Does any find that the way line breaks are handled are
a bit counter intuitive. For example, if I
enter:
line1
line2
you get:
line1line2
so to get
results that you would normally expect, you would have to do something like:
line1<br/>
line2<br/>
which is pretty ugly. I
thought I can live with it but it's starting to bug me too
much.
Suggestions?
Duke