Opened 6 years ago
Closed 6 years ago
#683 closed enhancement (fixed)
Auto-Close Markup Tags
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Back-end | Version: | |
| Severity: | normal | Keywords: | |
| Cc: |
Description
I would think that I wouldn't be the only one here that would like it if we could have a filter check to autoclose tags used in posts and replies to make sure that the markup doesn't continue past a post if someone forgets to close a tag.
Trent
Change History (6)
I discovered the use_balanceTags flag is not in BBpress, removed from WP.
Here's a workaround until it's fixed:
function force_balance_tags($text) { return balanceTags($text, true);}
add_filter('pre_post', 'force_balance_tags');
I was trying to use $bb->use_balanceTags=true but it wouldn't work because the option is not looked for in BBpress vs WP
- Owner set to mdawaffe
- Status changed from new to assigned
Worth noting that an extra </ol> will break the page, too. Balancing tags should work both ways if it doesn't already.
My mistake, it is a bbPress bug (that exists because the above problem with WP). I'm talking with some of the other WP devs now to get a solution that works well for both bb and WP.
AHA! I found a bug. Finally I can contribute.
Wordpress does indeed auto-close tags and has a fantastic routine, using function balancetags.
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) {
`
See what I mean? There's no manual 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.