Opened 7 years ago
Closed 5 years ago
#2239 closed defect (bug) (fixed)
Nested pre/blockquote in li produces invalid XHTML
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.6.1 |
| Component: | General | Version: | 2.0 |
| Severity: | normal | Keywords: | has-patch formatting wpautop xhtml |
| Cc: |
Description
Entering the following code in the plain editor produces invalid XHTML in WP 2.0 (worked fine with 1.5):
<ul>
<li>before<pre>pre1
pre2</pre>
after</li>
</ul>
The result has an unclosed p:
<li>before
<pre>pre1
pre2</pre>
<p>after</li>
</ul>
If one inserts an empty line before the closing li after "after", the p gets closed.
Attachments (1)
Change History (10)
comment:2
foolswisdom — 6 years ago
- Milestone changed from 2.2 to 2.3
Still present in trunk. Bug is somewhere within wptexturize or wpautop.
- Keywords has-patch wpautop added; needs-patch removed
This is caused by the ordering of replacements in wpautop(). "\n\n" is purposely inserted by one rule and later replaced with a <p> by another. The patch reorders the rules to avoid this.
- Owner changed from anonymous to pishmishy
- Status changed from new to assigned
- Keywords xhtml added
Attached a patch that cleanly applies to the current trunk code. Tested and appears to works fine.

This is still happening in SVN version [4984], exactly as described. Seems like it should be fixed...