Changeset 1295 for bbcode-lite

Show
Ignore:
Timestamp:
08/18/08 05:10:04 (4 months ago)
Author:
_ck_
Message:

remove bbpress's <br /> before or after <li> or </li>

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bbcode-lite/trunk/BBcode-lite.php

    r1294 r1295  
    2222if (preg_match_all("|\<code\>(.*?)\<\/code\>|sim", $text, $backticks)) {foreach ($backticks[0] as $backtick) {++$counter; $text=str_replace($backtick,"_bbcode_lite_".$counter."_",$text);}} 
    2323 
    24 $text = preg_replace('/\[(\*|li)\](.+?)(\[\/(\*|li)\]|(?=(\[(\*|li)\]|\[\/list\])))/sim','<li>$2</li>',$text); // * = li, a very special case since they may not be closed 
     24$text=preg_replace('/(\<br \/\>|[\s])*?\[(\*|li)\](.+?)(\<br \/\>|[\s])*?(\[\/(\*|li)\](\<br \/\>|[\s])*?|(?=(\[(\*|li)\](\<br \/\>|[\s])*?|\[\/list\])))/sim','<li>$3</li>',$text); // * = li, a very special case since they may not be closed 
    2525 
    2626$wrap = array('color' => array('font','color'),'size' => array('font','size'),'url' => array('a','href'), 'list' => array('ol','type'));