Make WordPress Core

Opened 12 years ago

Last modified 6 years ago

#23975 new defect (bug)

force_balance_tags in get_the_content breaks non-HTML formats

Reported by: ruckus's profile ruckus Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8
Component: Formatting Keywords:
Focuses: Cc:

Description

The change in r11398 (to fix #9765) breaks Markdown formatted articles that use angle bracket links: <http://example.com/> turning it into <http: //example.com></http:>.

If we call force_balance_tags after adding the more link, we need to establish filter hooks for formatters. This should have happened before r11398 already, but because balancing tags wasn't forced, this issue has not affected sites that disable balancing tags in their preferences.

Typically formatters attach to the the_content filter (among others). This should probably change into a get_the_content filter (similar to get_the_excerpt) that is called early on the full content of the post.

I haven't yet decided where the best place for the new filter would, or if it would be better to undo the force_balance_tags call.

Thoughts? I could work on the change, but would rather prefer some input first.

Attachments (1)

23975.diff (579 bytes) - added by ruckus 12 years ago.
Not a proposed fix, just showing a change that reverts to calling balanceTags but leaving the call after adding the more link.

Download all attachments as: .zip

Change History (4)

@ruckus
12 years ago

Not a proposed fix, just showing a change that reverts to calling balanceTags but leaving the call after adding the more link.

#1 @SergeyBiryukov
12 years ago

  • Version changed from trunk to 2.8

#2 @nacin
11 years ago

  • Milestone changed from Awaiting Review to Future Release

Hi ruckus, sorry you never got any direction on this one. That's a pretty old change you cite.

I think force_balance_tags() definitely makes sense here, but I also understand why this could cause problems. Perhaps tag balancing could be made smarter to not catch angle brackets used in this way. I agree that moving this to a filter could be a good idea.

#3 @netweb
10 years ago

Just bumped into this whilst investigating a balance tags issue:

Confirmed still occurring in r33159, pasting <http://example.com/> into a new post via the 'text" editor results in <http: example.com=""></http:>, slightly differing from the reported <http: //example.com></http:>.

Note: See TracTickets for help on using tickets.