WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 7 years ago

#4480 closed defect (bug) (wontfix)

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

Reported by: huesforalice Owned by: pishmishy
Milestone: Priority: lowest
Severity: minor Version: 2.2
Component: Template Keywords: wpauto
Focuses: 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 (7)

comment:1 @huesforalice8 years ago

  • 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

comment:2 @rob1n8 years ago

  • 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

comment:3 @rob1n8 years ago

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

comment:4 @Nazgul8 years ago

  • Milestone set to 2.4 (future)

comment:5 @lloydbudd7 years ago

  • Keywords wpauto added
  • Milestone changed from 2.4 to 2.5

comment:6 @pishmishy7 years ago

  • 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.

comment:7 @pishmishy7 years ago

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

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

Note: See TracTickets for help on using tickets.