Ticket #4480 (closed defect (bug): wontfix)

Opened 5 years ago

Last modified 4 years ago

Using two <br />'s in more text creates invalid markup

Reported by: huesforalice Owned by: pishmishy
Priority: lowest Milestone:
Component: Template Version: 2.2
Severity: minor Keywords: wpauto
Cc:

Description

During theming I tried to call the the_content() function in my index.php in this way:

<?php the_content('<br /><br />Read the rest of this entry &raquo;'); ?>

Wordpress then produces output like this:

<a href="somelink" class="more-link"></p>
<p>Read the rest of this entry &raquo;</a></p>

Which clearly is not valid xhtml.

When calling the_content only with one <br />:

<?php the_content('<br />Read the rest of this entry &raquo;'); ?>

All is ok.

Change History

  • Summary changed from Output of index.php not xhtml conform when enclosing to <br /> tags in the_content arguments to Output of index.php not xhtml conform when enclosing two <br /> tags in the_content arguments
  • Summary changed from Output of index.php not xhtml conform when enclosing two <br /> tags in the_content arguments to Using two <br />'s in more text creates invalid markup

I think the problem is that autop is applied after the more text is added on.

  • Milestone set to 2.4 (future)
  • Keywords wpauto added
  • Milestone changed from 2.4 to 2.5
  • Owner changed from anonymous to pishmishy
  • Status changed from new to assigned

huesforalice, I think that the best solution here would be for you to use the 'the_content' filter to remove the <p>.

The default filters for the_content such as autop could be moved so that they don't effect the more text, but that'll break things for people who wanted to use them to effect the more text.

  • Status changed from assigned to closed
  • Resolution set to wontfix
  • Milestone 2.6 deleted

No feed back so presuming that my suggestion fixes the problem.

Note: See TracTickets for help on using tickets.