- if ( $this->lastSection !== 'p' ) {
- $output .= $this->closeParagraph();
- $pendingPTag = '<p>';
- } else {
- $pendingPTag = '</p><p>';
- }
- }
- } else {
- if ( $pendingPTag ) {
- $output .= $pendingPTag;
- $pendingPTag = false;
- $this->lastSection = 'p';
- } elseif ( $this->lastSection !== 'p' ) {
- $output .= $this->closeParagraph() . '<p>';
- $this->lastSection = 'p';