Make WordPress Core

Opened 20 years ago

Closed 14 years ago

Last modified 14 years ago

#3007 closed defect (bug) (worksforme)

wpautop error when div tags lack space before or after other text

Reported by: erik Owned by:
Priority: normal Milestone:
Component: Formatting Version: 2.0.4
Severity: normal Keywords:
Cc: Focuses:

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 (13)

#1 @erik
20 years ago

  • Milestone2.1
  • Summary Texturize error with div-link-paragraph combinationTexturize error when div tags lack space before or after other text

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

<div>
<a href="http://example.com">example.com</a>

</div>

<div>

<a href="http://example.com">example.com</a>
</div>

<div>
Sample text.

</div>

<div>

Sample text.
</div>

Create these:


<div>
<a href="http://example.com">example.com</a></p>
</div>

<div>
<p><a href="http://example.com">example.com</a>
</div>

<div>
Sample text.</p>
</div>

<div>
<p>Sample text.
</div>

#2 @erik
20 years ago

  • Keywords wpautop added; texturize removed
  • Summary Texturize error when div tags lack space before or after other textwpautop error when div tags lack space before or after other text

Oops. Not texturize, but wpautop, I think.

#3 @matt
20 years ago

  • Milestone 2.12.2

#4 @foolswisdom
19 years ago

  • Milestone 2.22.4

#5 @anonymized_218323
19 years ago

  • Component GeneralTemplate

#6 @thee17
18 years ago

  • Milestone 2.52.6

#7 @Denis-de-Bernardy
17 years ago

  • Keywords needs-patch added; wpautop removed

the output changed somewhat, but the bug is still current

#8 @Denis-de-Bernardy
17 years ago

See also: #3362 (same bug with blockquotes)

#9 @Denis-de-Bernardy
17 years ago

  • Component TemplateFormatting

#10 @hakre
17 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.

related: #2833, #1706

#11 @azaozz
17 years ago

  • Milestone 2.9Future Release

#12 @wonderboymusic
14 years ago

  • Keywords needs-patch removed
  • Resolutionworksforme
  • Status newclosed

Currently, trunk (using the original examples) produces:

<div>
<p><a href="http://example.com">example.com</a>Some pretty words here.</p>
</div>
<div>
<p><a href="http://example.com">example.com</a></p>
<p>Some pretty words here.</p>
</div>
<div>
<p><a href="http://example.com">example.com</a></p>
<p>Some pretty words here.</p>
</div>

I'm inclined to think this is working as expected. If you are using newlines in the editor to produce line-breaks that result in <p>s, you can preview til your heart's content.

#13 @helenyhou
14 years ago

  • Milestone Future Release
Note: See TracTickets for help on using tickets.