I've got sloppy members not closing their tags and the markup runs through the rest of the page. Doesn't WP already do auto close on tags? Did bbpress not pick up that part of the code?
bbPress support forums » Troubleshooting
bbpress doesn't auto-close tags?
(7 posts)-
Posted 12 months ago #
-
WP doesn't auto close tabs by default either (unless the new editor does it). Does anyone know if the QuickTags plugin for bbPress auto closes tabs?
Trent
Posted 12 months ago # -
Posted 12 months ago #
-
Actually I may be wrong about this.
I dug through the default filters and I see this:
add_filter('pre_post', 'balanceTags');
Does balancetags == auto-close tags?
Looking at the function it would seem to be so.Perhaps I have a plugin conflict or does this behaviour exist on even on a default install?
added: I just tested here and yup, it doesn't auto-close
Posted 12 months ago # -
AHA!
I found a bug. Finally I can contribute.
Wordpress does indeed auto-close tags and has a fantastic routine, the balancetags I mentioned above.
HOWEVER
it was copied raw into BBpress and it won't work by default because it's looking for an option that will never be set because BBpress doesn't have it
function balanceTags($text, $is_comment = 0, $force = false) {if ( !$force && get_option('use_balanceTags') == 0 )
return $text;
See what I mean? There's no manually way to set use_balanceTags in BBpress.
So how do we force the filter on? I know it has to be balanceTags ($text,1,1) to work.
Posted 12 months ago # -
Yay! I figured out how to hack it to make it happen.
To leave the core files alone, I did it through a plugin.
The balancetags in bbpress takes less parameters than from WP.
function force_balance_tags($text) { return balanceTags($text, true);}
add_filter('pre_post', 'force_balance_tags');
Tested working.
Another nice addition in there would be to add nofollow to any post links.
add_filter('pre_post', 'bb_rel_nofollow');
Posted 12 months ago # -
works wonderfully ... now to see if I can make it work for the bb-signatures plugin :).
Posted 10 months ago #
Reply
You must log in to post.