Ticket #2259 (reopened defect)

Opened 2 years ago

Last modified 4 months ago

autop creates unclosed paras inside list items

Reported by: Viper007Bond Assigned to: anonymous
Priority: low Milestone: 2.6
Component: Template Version: 2.0
Severity: minor Keywords: autop has-patch
Cc:

Description

This is what I entered into my post:

<strong>Frequently Asked Questions:</strong>

<ul>
	<li><strong>Q:</strong> My points are too low! Both BFHQ ingame and BF2S.com show more points than the plugin is currently showing. Why is that?

<strong>A:</strong> This plugin only refreshes it's data every 6 hours as BF2S.com only allows 3 queries per 6 hours per IP address. This plugin is limited to just 1 query per 6 hours incase anyone else on your server also uses this plugin, plus 6 hours isn't all that long.</li>
	<li><strong>Q:</strong> The plugin output says I'm 100% to the next rank and I have more points than required to get the next rank. What's going on?

<strong>A:</strong> Go play on a different server and get a kill. Your rank should be updated then.</li>
</ul>

This is what was outputted:

<p><strong>Frequently Asked Questions:</strong></p>
<ul>
<li><strong>Q:</strong> My points are too low! Both BFHQ ingame and BF2S.com show more points than the plugin is currently showing. Why is that?
<p><strong>A:</strong> This plugin only refreshes it&#8217;s data every 6 hours as BF2S.com only allows 3 queries per 6 hours per IP address. This plugin is limited to just 1 query per 6 hours incase anyone else on your server also uses this plugin, plus 6 hours isn&#8217;t all that long.</li>
<li><strong>Q:</strong> The plugin output says I&#8217;m 100% to the next rank and I have more points than required to get the next rank. What&#8217;s going on?

<p><strong>A:</strong> Go play on a different server and get a kill. Your rank should be updated then.</li>
</ul>

Note the lack of </p>'s.

Attachments

wp_multiline_li_unclosed_p.patch (1.2 kB) - added by ono on 08/03/07 11:16:10.
This patch fixes closing of para for last line of multiline list items

Change History

01/10/06 18:25:29 changed by skeltoac

Please note exactly what behavior you expected.

01/10/06 18:41:52 changed by davidhouse

I guess,

{{{<p><strong>Frequently Asked Questions:</strong></p> <ul> <li><p><strong>Q:</strong> My points are too low! Both BFHQ ingame and BF2S.com show more points than the plugin is currently showing. Why is that?</p> <p><strong>A:</strong> This plugin only refreshes it&#8217;s data every 6 hours as BF2S.com only allows 3 queries per 6 hours per IP address. This plugin is limited to just 1 query per 6 hours incase anyone else on your server also uses this plugin, plus 6 hours isn&#8217;t all that long.</p></li> <li><p><strong>Q:</strong> The plugin output says I&#8217;m 100% to the next rank and I have more points than required to get the next rank. What&#8217;s going on?</p>

<p><strong>A:</strong> Go play on a different server and get a kill. Your rank should be updated then.</p></li> </ul>}}}

Would be the correct behaviour.

01/10/06 18:43:02 changed by davidhouse

Grr.

<p><strong>Frequently Asked Questions:</strong></p> <ul> <li><p><strong>Q:</strong> My points are too low! Both BFHQ ingame and BF2S.com show more points than the plugin is currently showing. Why is that?</p> <p><strong>A:</strong> This plugin only refreshes it&#8217;s data every 6 hours as BF2S.com only allows 3 queries per 6 hours per IP address. This plugin is limited to just 1 query per 6 hours incase anyone else on your server also uses this plugin, plus 6 hours isn&#8217;t all that long.</p></li> <li><p><strong>Q:</strong> The plugin output says I&#8217;m 100% to the next rank and I have more points than required to get the next rank. What&#8217;s going on?</p>

<p><strong>A:</strong> Go play on a different server and get a kill. Your rank should be updated then.</p></li> </ul>

01/10/06 18:44:52 changed by davidhouse

Let's try that one more time with feeling.

<p><strong>Frequently Asked Questions:</strong></p>

<ul>
<li><p><strong>Q:</strong> My points are too low! Both BFHQ ingame and BF2S.com show more points than the plugin is currently showing. Why is that?</p>
<p><strong>A:</strong> This plugin only refreshes it&#8217;s data every 6 hours as BF2S.com only allows 3 queries per 6 hours per IP address. This plugin is limited to just 1 query per 6 hours incase anyone else on your server also uses this plugin, plus 6 hours isn&#8217;t all that long.</p></li>
<li><p><strong>Q:</strong> The plugin output says I&#8217;m 100% to the next rank and I have more points than required to get the next rank. What&#8217;s going on?</p>

<p><strong>A:</strong> Go play on a different server and get a kill. Your rank should be updated then.</p></li>
</ul>

01/10/06 18:46:22 changed by davidhouse

Okay, I give up. Basically, the <p>s should be closed before the </li>s and probably be opened <p> after the <li>s.

01/10/06 22:25:21 changed by skeltoac

  • status changed from new to closed.
  • resolution set to invalid.

I don't expect autop to nest blocks or read minds. Write a patch, use a proper definition list or use <br /> in your list items.

01/11/06 09:54:05 changed by Viper007Bond

  • status changed from closed to reopened.
  • severity changed from normal to minor.
  • component changed from Administration to General.
  • priority changed from normal to low.
  • version changed from 1.2 to 2.0.
  • resolution deleted.

I thought I was being clear, cut me some slack please.

Let me to to re-explain. I enter this mutli-paragraph unordered list:

<ul>
	<li>Item 1, Paragraph 1

Item 1, Paragraph 2</li>
	<li>Item 2, Paragraph 1

Item 2, Paragraph 2</li>
</ul>

No <p>'s, just a list.

I get back this:

<ul>
<li>Item 1, Paragraph 1
<p>Item 1, Paragraph 2</li>
<li>Item 2, Paragraph 1
<p>Item 2, Paragraph 2</li>
</ul>

It has added in 2 <p>'s. I'm not expecting it to read my mind, but it's not even adding the closing tags for the tags it inserted.

As for a patch, I'm sorry, but I'm not as experienced in how this function works as you may be and wouldn't know where to begin on how to fix it.

Sorry for trying to make WordPress better.

01/12/06 19:44:09 changed by skeltoac

  • summary changed from More autop bugginess to autop creates unclosed paras inside list items.
  • milestone set to 2.1.

Viper, I understand your bug report and I wouldn't prevent you from submitting more like it. I should have made this a balance_tags issue rather than close it. It'll be taken care of. I'm changing the summary to reflect the actual problem.

11/29/06 21:09:33 changed by matt

  • milestone changed from 2.1 to 2.2.

02/01/07 17:55:33 changed by priv

In 2.1 the autop are more insane.

Following source:

<ul>
<li>Item 1, Paragraph 1<br /> <br />Item 1, Paragraph 2</li>
<li>Item 2, Paragraph 1<br /> <br />Item 2, Paragraph 2</li>
</ul>

after apply filter will also become

<ul>
<li>Item 1, Paragraph 1
<p>Item 1, Paragraph 2</li>
<li>Item 2, Paragraph 1
<p>Item 2, Paragraph 2</li>
</ul>

You don't have chance to add a newline in the list without break html.

And also, seems now 2.1 eat up any amount of br tags and newlines, and results in p tags.

The only way to get extra space is <p>&nbsp;</p>, and don't think of use it in the list, since it will create a three-line space. Oh, wait, maybe we can turn off the space between paragraph by inline css.

I must say the autop guys are really hate br and newlines, aren't they?

More worse, in 2.1 they're trying to strip the <p> structures created by TinyMCE before saving(to tidy the result??), so the output will have no choice but rely on autop.

If the filter will stay as a set of regexp and won't become a full parser, please don't do too much of the 'smart things', ridiculous.

05/01/07 13:46:00 changed by Nazgul

  • keywords set to needs-patch.
  • milestone changed from 2.2 to 2.4.

08/03/07 11:16:10 changed by ono

  • attachment wp_multiline_li_unclosed_p.patch added.

This patch fixes closing of para for last line of multiline list items

08/03/07 11:18:22 changed by ono

Hi,

I've hit the same problem, and my site no longer was validating with XHTML.

Attaching patch that hopefully fixes it. Please include it into new bugfix release of WP.

Best regards!

08/14/07 16:00:23 changed by Nazgul

  • keywords changed from needs-patch to has-patch.
  • milestone changed from 2.4 (future) to 2.3 (trunk).

09/18/07 18:14:40 changed by foolswisdom

  • milestone changed from 2.3 to 2.4.

12/16/07 21:33:41 changed by darkdragon

  • keywords changed from has-patch to autop has-patch.

12/27/07 20:59:31 changed by santosj

  • component changed from General to Template.

03/12/08 03:14:32 changed by lloydbudd

  • milestone changed from 2.5 to 2.6.