vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   VB adding <br>'s to posts (https://vborg.vbsupport.ru/showthread.php?t=274722)

ToKey 11-27-2011 08:03 PM

VB adding <br>'s to posts
 
I'm sure someone else has run into this but I haven't seen anything.

This is weird behavior where <br>s are getting added to posts, specifically when using table tags.

For instance, I'll have the following post:

Quote:

This is where we will keep track of who buys admin and how long they will have it for.
[table]
[tr]
[td]Name[/td]
[td]SteamID[/td]
[td]Type[/td]
[...]
I've tried both with BB table tags and real HTML. On submitting around 100 <br> tags get added to the outputted HTML just before the table tag.

Anyone else run into this? What function is doing this so I can try and fix it.

Lynne 11-27-2011 08:41 PM

Well, when you type this:
hello
hello again

Then you end up with <br> between lines, so why would you expect any different when using tags?

ToKey 11-28-2011 12:11 AM

What I'm posting

https://vborg.vbsupport.ru/external/2011/11/25.png

What I'm getting

https://vborg.vbsupport.ru/external/2011/11/26.png

It's not adding one br, it's adding a hundred.

Lynne 11-28-2011 04:41 AM

I don't know why it's adding a hundred, but did you try putting it all on one line which is what you need to do?

ToKey 11-28-2011 06:34 AM

Quote:

Originally Posted by Lynne (Post 2272627)
I don't know why it's adding a hundred, but did you try putting it all on one line which is what you need to do?

I see what's happening.

Given the example
Code:

<table>
<tr>
<td></td>
<td></td>
</tr>
[...]

The parser will turn it into
Code:

<table><br />
<tr><br />
<td></td><br />
<td></td><br />
</tr><br />
[...]

Well <br /> elements aren't allowed in these places. Because of that the browser is interpreting it as
Code:

<br />
<br />
<br />
<br />
<br />
<table>
<tr>
<td></td>
<td></td>
</tr>
[...]

So in the end it's the browser that is doing, but the parser could be made to check for invalid tags like this and choose not to turn the new lines into br's.

I did find a way around it for now though.

Code:

<table><tr><td>Table cell text
</td><td>Table cell text
</td></tr>Table cell text
[...]

Because the br is being placed in the td (a valid place), the breaks don't get moved out of that table AND because there's only one break with nothing after it, most browsers will ignore it, giving you a clean table with no errors.

My one complaint is that it looks really bad for formatting and my mods have difficulty following the pattern when making edits.


All times are GMT. The time now is 07:55 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02119 seconds
  • Memory Usage 1,722KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete