manually fix escaped underscores in links

This commit is contained in:
Zach Prezkuta 2012-08-26 18:18:43 -06:00
parent 9ae5ae6df5
commit f7a1999c15
2 changed files with 40 additions and 0 deletions

View file

@ -47,6 +47,30 @@ function bb_unspacefy_and_trim($st) {
return $unspacefied;
}
function bb_find_open_close($s, $open, $close, $occurance = 1) {
if($occurance < 1)
$occurance = 1;
$start_pos = -1;
for($i = 1; $i <= $occurance; $i++) {
if( $start_pos !== false)
$start_pos = strpos($s, $open, $start_pos + 1);
}
if( $start_pos === false)
return false;
$end_pos = strpos($s, $close, $start_pos);
if( $end_pos === false)
return false;
$res = array( 'start' => $start_pos, 'end' => $end_pos );
return $res;
}
function get_bb_tag_pos($s, $name, $occurance = 1) {
if($occurance < 1)