Just a
me-too, to calibrate the level of annoyance.
However, I've been resigned to it, mostly because I think I agree with
Brandon that fixing it is fraught with more than annoyance. But perhaps
not; perhaps one could toss together a Radeox macro that would, like the
{pre} and {code} macros, generate HTML that honored ordinary typewriter-like
formatting and didn't collapse whitespace, but not ignore the wiki
syntax.
I've
actually had more trouble with making sure that #included files didn't get
rendered more than once, with the result that paragraph tags generated for blank
lines caused syntax errors in {pre} text that was later parsed by javascript or
CSS, but again I've been more or less resigned to it, as to many such annoyances
that almost inevitably result from mixing languages in the same
document.
A
humorous (now...!) example is what happened when I opened a document with the
single line
Hi.
I still don't know what caused it, but it didn't look anything like I expected...
brain[sic]
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