UseBB Community

The official board for UseBB help and discussion

UseBB Community » Bug Reports » [FIXED] Make the BBCode controls valid

[FIXED] Make the BBCode controls valid

Page: 1

Author Post
Member
Registered: Aug 2006
Posts: 43
Location: The Netherlands
Find in functions.php:
Quote
$out[] = '<a href="javascript:insert_tags(\''.$data[0].'\', \''.$data[1].'\')" style="'.$data[3].'">'.$data[2].'</a>';

Replace it with:
Quote
$out[] = '<a href="javascript:insert_tags(\''.$data[0].'\',%20\''.$data[1].'\')" style="'.$data[3].'">'.$data[2].'</a>';

The reason for the HTML code of the editor buttons not to validate, is caused by a space between the arrays data[0] and data[1].
Result of this patch: ~10 HTML warnings less.
« Last edit by Dietrich on Thu Nov 23, 2006 8:55 pm. »
Developer
Registered: Apr 2004
Posts: 2216
Location: Belgium
I don't seem to get any warnings when validating the post form...?
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog
Member
Registered: Aug 2006
Posts: 43
Location: The Netherlands
I use a Firefox extension to validate it. It's called Tidy.
User posted image
Developer
Registered: Apr 2004
Posts: 2216
Location: Belgium
I see. We could fix this problem easily, though I should mention that those BBCode controls weren't really made the way Javascript controls should be. These are put into the href attribute, while it should be at least into the onclick attribute.

In a perfect world, it should all be rendered using the DOM, which is what we are going to try with UseBB 2. So for now I'll try to change it, eventually using onclick, but it remains a dirty implementation somehow.

Edit: fixed in CVS.
_______________
--Dietrich (developer)
UseBB roadmap, dev mailing list & weblog
« Last edit by Dietrich on Thu Nov 23, 2006 8:55 pm. »
Member
Registered: Aug 2006
Posts: 43
Location: The Netherlands
Thanks for taking the time :) I hope I can take some time in the new year to improve version 1, possibly helping you out when v2 is released, but don't count me on it ;)

Page: 1

UseBB Community » Bug Reports » [FIXED] Make the BBCode controls valid

UseBB Community is powered by UseBB 1 Forum Software