Tables in news posts won't work well with new lines

Is something wonky on the site? Describe the problem to us, and we'll fix it ASAP.
Forum rules
Bug Reporting Guidelines

Before Posting
Please make sure someone hasn't already reported the problem you're experiencing before creating a new topic. Confirmed issues have been stickied in this forum.

Rules

    1) Use a descriptive title when starting a bug topic. Example: "Comic images not showing up" Do not use vague titles like, "problem" or "uh ohh"

    2) Describe your problem in detail. Explain exactly what is wrong. Post images, screen shots, links, code snippets - whatever is relevant. The better the information you provide, the better the solution you will receive.

    3) Be polite and patient. We fix these issues as fast as we can. Please be patient with us as we work toward a solution.

Tables in news posts won't work well with new lines

Postby The_mad_one » May 20th, 2012, 10:33 am

Hi,

Djoing and me have this new post with a table for keeping scores. Trivial little thing, but:

When we declare the table like this:

Code: Select all
<table border='1'>
<tr><td>blabla</td><td>blabla</td></tr>
<tr><td>blabla</td><td>blabla</td></tr>
<tr><td>blabla</td><td>blabla</td></tr>
<tr><td>blabla</td><td>blabla</td></tr>
<tr><td>blabla</td><td>blabla</td></tr>
<tr><td>blabla</td><td>blabla</td></tr>
</table>


We expect to see

*-----*
____________
|blabla|blabla|
|blabla|blabla|
|blabla|blabla|
|blabla|blabla|
|blabla|blabla|
|blabla|blabla|


*-----*

But in stead, we get:

*-----*








____________
|blabla|blabla|
|blabla|blabla|
|blabla|blabla|
|blabla|blabla|
|blabla|blabla|
|blabla|blabla|


*-----*

For some reason, it responds to every new line by adding that line above the table.


If we enter this:

Code: Select all
<table border='1'>
<tr><td>blabla</td><td>blabla</td></tr>text
<tr><td>blabla</td><td>blabla</td></tr>text
<tr><td>blabla</td><td>blabla</td></tr>text
<tr><td>blabla</td><td>blabla</td></tr>text
<tr><td>blabla</td><td>blabla</td></tr>text
<tr><td>blabla</td><td>blabla</td></tr>text
</table>


We get this:

*-----*


text
text
text
text
text
text
____________
|blabla|blabla|
|blabla|blabla|
|blabla|blabla|
|blabla|blabla|
|blabla|blabla|
|blabla|blabla|


*-----*

Not sure what causes it, but it would be nice if that would be fixed. Right now, our only solution is to place the entire block of html on a single illegible line.

Hope this helps, thanks in advance!
Image
User avatar
The_mad_one
 
Posts: 11
Joined: September 5th, 2008, 11:17 am

Re: Tables in news posts won't work well with new lines

Postby eishiya » May 20th, 2012, 3:22 pm

This is expected behaviour. Any text in a table that's not contained in <td> is shown at the start of the table.

SJ processes news posts and converts all the linebreaks into <br> (the HTML code for a linebreak). Since this is considered text, and it's outside any table data cells, it's printed at the start of the table. The News posts are supposed to be regular text like in comments, and there's not much that can be done to preserve the line breaks in normal text while also making it easy for HTML code to work properly.
In templates, SJ does not convert linebreaks to <br>, which is why it doesn't happen in the templates.

The HTML functionality in comments and news posts wasn't meant for things like tables, I guess. Sadly, I think all you can do is have your code in one run-on line, as changing SJ's parser to automatically (and accurately) determine whether a linebreak is intentional or incidental is far more work than it's worth.
Busy, busy.
User avatar
eishiya
 
Posts: 5838
Joined: December 5th, 2009, 11:17 am

Re: Tables in news posts won't work well with new lines

Postby The_mad_one » May 25th, 2012, 4:40 pm

Makes sense, I guess. Too bad...

Thanks for your response.
Image
User avatar
The_mad_one
 
Posts: 11
Joined: September 5th, 2008, 11:17 am

Re: Tables in news posts won't work well with new lines

Postby Asj » May 25th, 2012, 6:06 pm

what if you fill in that space with words? Like, if you want to say something before you add the table, add it between the table rows instead. That way, it'll use up the extra space at the top.
Image
User avatar
Asj
 
Posts: 944
Joined: January 4th, 2009, 5:42 pm

Re: Tables in news posts won't work well with new lines

Postby The_mad_one » May 26th, 2012, 7:09 pm

Frankly, I think that would make the code even more difficult to read. ^^'
Image
User avatar
The_mad_one
 
Posts: 11
Joined: September 5th, 2008, 11:17 am

Re: Tables in news posts won't work well with new lines

Postby Asj » May 26th, 2012, 8:41 pm

...maybe. But it's the kind of weird thing I'd do. ^_^"
Image
User avatar
Asj
 
Posts: 944
Joined: January 4th, 2009, 5:42 pm


Return to Bugs & Glitches

Who is online

Users browsing this forum: No registered users and 1 guest