Ticket #6297 (closed defect (bug): duplicate)

Opened 4 years ago

Last modified 3 years ago

Unbalanced tags across more and nextpage tags

Reported by: tellyworth Owned by:
Priority: normal Milestone:
Component: Formatting Version: 2.5
Severity: normal Keywords: needs-patch
Cc:

Description

It's easy to produce broken front page markup by including a --nextpage-- tag that breaks an enclosing bold or italic tag. There's some code in get_the_content that fixes this for --more-- tags, but it doesn't handle --nextpage--, and it'd be more efficient to do it at post save time.

The enclosed patch fixes this by splitting the content into slices at those boundaries and separately balancing each slice. Balancing happens in the content_save_pre action. No filtering is needed on the output side for posts saved after this filter.

It was a bit of a struggle figuring out where to fit this but I think the solution is fairly clean. It includes a new split_nextpage() function that can be used instead of ad-hoc regexps for splitting a post into pages.

Attachments

balance-tags-with-more-r7392.patch Download (3.2 KB) - added by tellyworth 4 years ago.

Change History

By "No filtering is needed on the output side" I mean no _balance_ filtering of course.

  • Version set to 2.5
  • Milestone changed from 2.7 to 2.6

comment:4   ryan4 years ago

  • Milestone changed from 2.9 to 2.7

comment:5   ryan3 years ago

  • Milestone changed from 2.7 to 2.8

ah, yes, the number of sidebar gets knocked down issues that this might fix...

  • Keywords needs-patch added; has-patch removed
  • Milestone changed from 2.8 to Future Release

broken patch

  • Owner anonymous deleted
  • Component changed from General to Formatting
  • Status changed from new to closed
  • Resolution set to duplicate
  • Milestone Future Release deleted

fixed in r11398

Note: See TracTickets for help on using tickets.