Ticket #3007 (new defect (bug))
wpautop error when div tags lack space before or after other text
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Formatting | Version: | 2.0.4 |
| Severity: | normal | Keywords: | needs-patch |
| Cc: |
Description
Texturize appears to have an issue figuring out where to put the paragraph tags if there are no lines between a div tag and the previous or next piece of text.
(Note: This is all with the visual rich editor turned off.)
I type this as the post content:
<div> <a href="http://example.com">example.com</a> Some pretty words here. <div>
The source of the post when it is viewed is this:
<div> <a href="http://example.com">example.com</a></p> <p>Test </div>
The paragraph tags don't come out quite right.
This text, with a line between opening the div and the link:
<div> <a href="http://example.com">example.com</a> Some pretty words here. </div>
Gets this source:
<div> <p><a href="http://example.com">example.com</a></p> <p>Some text here. </div>
Now the first paragraph tags open and close as expected.
Finally, if I put lines between both the open and close div tags and the nearest text:
<div> <a href="http://example.com">example.com</a> Some pretty words here. </div>
I get this source:
<div> <p><a href="http://example.com">example.com</a></p> <p>Some text here.</p> </div>
Now both come out as expected.
Change History
- Summary changed from Texturize error with div-link-paragraph combination to Texturize error when div tags lack space before or after other text
- Milestone set to 2.1
- Keywords wpautop added; texturize removed
- Summary changed from Texturize error when div tags lack space before or after other text to wpautop error when div tags lack space before or after other text
Oops. Not texturize, but wpautop, I think.
- Keywords needs-patch added; wpautop removed
the output changed somewhat, but the bug is still current
See also: #3362 (same bug with blockquotes)
comment:10
hakre — 2 years ago
Please close as wontfix. Fixing things will break other things and vice-versa. I do not know a single serious developer that wants to touch this.
Best would be to get a binding description first what must (not)/should (not)/can (not) be done by wpautop. Then testcases must be written (executeable ones) and then the function can be developed accordingly.

Further examples, with only one thing between the divs. These:
Create these: