Make WordPress Core

Opened 19 years ago

Closed 18 years ago

#4480 closed defect (bug) (wontfix)

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: Focuses:

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)

#1 @huesforalice
19 years ago

  • Summary Output of index.php not xhtml conform when enclosing to <br /> tags in the_content argumentsOutput of index.php not xhtml conform when enclosing two <br /> tags in the_content arguments

#2 @rob1n
19 years ago

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

#3 @rob1n
19 years ago

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

#4 @Nazgul
19 years ago

  • Milestone2.4 (future)

#5 @lloydbudd
19 years ago

  • Keywords wpauto added
  • Milestone 2.42.5

#6 @pishmishy
19 years ago

  • Owner changed from anonymous to pishmishy
  • Status newassigned

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.

#7 @pishmishy
18 years ago

  • Milestone 2.6
  • Resolutionwontfix
  • Status assignedclosed

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

Note: See TracTickets for help on using tickets.