Make WordPress Core

Opened 16 years ago

Closed 7 years ago

#16790 closed enhancement (maybelater)

Functional spec for wpautop

Reported by: mrclay Owned by:
Priority: normal Milestone:
Component: Formatting Version:
Severity: minor Keywords: wpautop needs-patch
Cc: Focuses:

Description

I've put together an algorithm-based ​functional spec that I hope could be useful in maintaining wpautop. Also might be handy is this combination of ​wpautop failure cases.

The algorithm is based on work I've started on a DOMDocument-based implementation (a project I contribute to needs an MIT-licensed version), and although it's incomplete and slow, it does a bang-up job so far.

DOMDocument may just be too slow or strict in its parsing to allow the variety of markup that wpautop needs to accept, but it's ace at the level of surgical precision needed to do this right.

Change History (7)

#1 @scribu
16 years ago

  • Owner set to scribu
  • Status new → reviewing

Although not directly relevant, it's good to remember that the HTML runs through kses afterwards, which can alter it significantly.

#2 @scribu
16 years ago

  • Owner scribu removed

#3 @nacin
14 years ago

  • Component Unit Tests → Formatting

This is cool. For anything not currently covered by tests, it'd be great if we added unit tests for those.

Maybe such a document could find its way into ​http://make.wordpress.org/core/handbook/ as an appendix of some sort.

#4 @nacin
13 years ago

  • Keywords wpautop added

This ticket was mentioned in IRC in #wordpress-dev by miqrogroove. ​View the logs.


12 years ago

#6 @chriscct7
11 years ago

  • Keywords needs-patch added

#7 @pento
7 years ago

  • Resolution → maybelater
  • Status reviewing → closed

It's interesting to explore, but I'm not sure there's a practical way to replace wpautop() with a proper HTML parser.

I'm fine with reopening this ticket at a later date if someone has a working solution for it.

Note: See TracTickets for help on using tickets.