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
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:[email protected]] Sent: 27 July 2006 15:58 To: [email protected] 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
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] -----Original Message----- From: Esbach, Brandon [mailto:[email protected]] Sent: Thursday, July 27, 2006 10:14 AM To: [email protected] Subject: RE: [xwiki-users] line breaks 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:[email protected]] Sent: 27 July 2006 15:58 To: [email protected] 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
Alternatives are to put them in separate <p> elements like this: line1 line2 Or generate the linebreak through Radeox like this: line1\\ line2 Regards, Robin On 27/07/06, Esbach, Brandon <[email protected]> wrote:
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:[email protected]] Sent: 27 July 2006 15:58 To: [email protected] 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
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
The main reason why most Wiki Syntaxes are ignoring single line breaks and using a paragraph for double line breaks, if I remember well, is because textareas would scroll if you typed your text on a single line (see http://www.idocs.com/tags/forms/_TEXTAREA_WRAP.html). Therefore to make the text readable, you would type carriage return regularly, which thanks to the wiki syntax would be ignored. I agree that today all serious browsers wrap the text properly so this is not usefull anymore and counter intuitive. Wysiwyg also renders that unusefull. It's also not what people expect with their habits of Word Processor. What worried me is backwards compatibility and the way this would impact pages including scripting if we change the behavior to include a <br /> We could at least make it an option of the wiki and maybe even an option of the page. Ludovic Duke Tantiprasut a écrit :
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 ------------------------------------------------------------------------
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- Ludovic Dubost XPertNet: http://www.xpertnet.fr/ Blog: http://www.ludovic.org/blog/ XWiki: http://www.xwiki.com Skype: ldubost AIM: nvludo Yahoo: ludovic
I think this would be a great addition and worth the effort, and would gladly help where I can. Duke On 7/27/06, Ludovic Dubost <[email protected]> wrote:
The main reason why most Wiki Syntaxes are ignoring single line breaks and using a paragraph for double line breaks, if I remember well, is because textareas would scroll if you typed your text on a single line (see http://www.idocs.com/tags/forms/_TEXTAREA_WRAP.html). Therefore to make the text readable, you would type carriage return regularly, which thanks to the wiki syntax would be ignored.
I agree that today all serious browsers wrap the text properly so this is not usefull anymore and counter intuitive. Wysiwyg also renders that unusefull. It's also not what people expect with their habits of Word Processor.
What worried me is backwards compatibility and the way this would impact pages including scripting if we change the behavior to include a <br /> We could at least make it an option of the wiki and maybe even an option of the page.
Ludovic
Duke Tantiprasut a écrit :
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 ------------------------------------------------------------------------
-- You receive this message as a subscriber of the [email protected] mailing list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
-- Ludovic Dubost XPertNet: http://www.xpertnet.fr/ Blog: http://www.ludovic.org/blog/ XWiki: http://www.xwiki.com Skype: ldubost AIM: nvludo Yahoo: ludovic
-- You receive this message as a subscriber of the [email protected] list. To unsubscribe: mailto:[email protected] For general help: mailto:[email protected]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
participants (5)
-
Duke Tantiprasut -
Esbach, Brandon -
Ludovic Dubost -
Robin Fernandes -
THOMAS, BRIAN M (SBCSI)