This discussion is archived
0 Replies Latest reply: Jul 16, 2013 2:29 PM by Dude! RSS

BUG: Forum uses HTML <p> instead of <br> tags.

Dude! Guru
Currently Being Moderated

It seems to me the editor or whatever parses the text of messages for input has a rather serious bug by generally replacing all line endings with HTML <p> tags.

 

For instance:

 

The orange frog jumps over the blue dog

to escape from the yellow cat.

 

When I copy the above lines from the browser and paste them into MS-Word, each line defines a paragraph set to "auto" line spacing, showing up as double spacing. When I copy the text into a text editor, it shows an empty line between each line, and 3 empty lines between paragraphs.

 

Here are the screenshots to demonstrate the issue:

http://www.freeimagehosting.net/newuploads/8s364.jpg

http://www.freeimagehosting.net/newuploads/qm68k.jpg

 

Trying to find the cause of the problem, I checked the following:

 

The editor HTML mode shows the following:

 

<body><p>Analyzing editor bug:</p>

<p></p>

<p>The orange frog jumps over the blue dog</p>

<p>to escape from the yellow cat.</p></body>

 

The page source, showing up in the browser shows:

 

<div class="jive-rendered-content"><p>Analyzing editor bug:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">& nbsp; </p><p>The orange frog jumps over the blue dog</p><p>to escape from the yellow cat.</p></div>

 

 

I'm not a HTML expert, and the page source does not show what "jive-rendered-content" is doing, but I suppose it makes the output showing no paragraphs and hence no empty line unless there is a nbsp character that was added. However, when copying the content, it uses the page source, which interprets the HTML p tag as a paragraph marker and hence divides each paragraph by an empty line.

 

Whatever logic there is to determine new lines and paragraphs, it is messing up with posted code and any fix will probably require to replace physical content of text in the future.

 

P.S. When I re-edited this post to make some correction, it also added empty lines to paragraphs. Perhaps it is using the length of lines to determine paragraphs, which is not reliable. This is however not always visible, depending on the forum response time. Sometimes text magically appears with additional paragraphs when leaving it alone on screen for a while. Or pasted text has no empty lines, which takes a while to reappear.

 

Based on my experience in the development of editors, such issues are often introduced by some logic or intent to convert hard wrapped text to soft wrapped text by removing line endings and reconstructing paragraphs based on "paragraph" logic. However, in such case, considering that people post code here, the change to mess up code is probably not worth the risk to convert paragraphs.