Recent Topics

Ordered lists break validation

Started by on Apr 19, 2007 – Contents updated: Apr 19, 2007

Apr 19, 2007 16:14    

Using the quicktag button for OL produces <br> tags after all but the last </li> tag. This is with auto-P on by the way, just in case that's part of the solution.

This is what I have in a blog post:

Code

<ul>
<li>Unordered Lists suck to make.</li>
<li>They are not friendly.</li>
<li>But they can be styled!</li>
</ul>
 
<ol>
<li>Ordered Lists suck to make.</li>
<li>They are not friendly.</li>
<li>But they can be styled!</li>
</ol>

Viewing the source reveals this:

Code

<ul>
<li>Unordered Lists suck to make.</li>
<li>They are not friendly.</li>
<li>But they can be styled!</li>
</ul>
 
<ol>
<li>Ordered Lists suck to make.</li><br>
<li>They are not friendly.</li><br>
<li>But they can be styled!</li>
</ol>

BTW I can make it work properly by putting my everything for the ordered list on one line in the blog post. Like this:

Code

<ol><li>Ordered Lists suck to make.</li><li>They are not friendly.</li><li>But they can be styled!</li></ol>

---------------

Unrelated: why would b2evolution produce <br> when it should be <br />?

Apr 20, 2007 10:37

Crack open auto-p and remove the ol from this bit ( approx line 40 ) and see if that cures your problem :-

PHP

var $br_allowed_in array(
        // Block level:
        'address''center''dl''dir''div''fieldset''form''h1''h2''h3''h4''h5''h6''hr''isindex''menu''noframes''noscript''ol''p''pre',

The plugin actually adds <br /> ?

PHP

function autobr$text$replace_last true )
    {
        if( ! $this->use_auto_br )
        { // don't make <br />'s
            return $text;
        }
 
        return preg_replace'~(?<!<br />)\n'.( $replace_last '' '(?!\z)' ).'~i'"<br />\n"$text );
    }

¥

Apr 22, 2007 09:28

I'll be darned! Removing ol from that list worked, but for sure the problem was having a <br> tag - not a <br /> tag. There are a handful of files that have "<br>" in them, but none of them seemed like they would kick in when rendering happened.

Anyway that solves the problem so hooray!


Form is loading...

powered by b2evolution – This forum is powered by b2evolution CMS, a complete engine for your website.