/[drupal]/contributions/sandbox/alaa/bidi.module
ViewVC logotype

Diff of /contributions/sandbox/alaa/bidi.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.3, Fri Aug 18 03:50:07 2006 UTC revision 1.4, Sat Jun 9 22:16:45 2007 UTC
# Line 146  function _bidi_filter_process($text) { Line 146  function _bidi_filter_process($text) {
146          continue;          continue;
147          break;          break;
148    
149        //nested cases  
150          // block elements these get out attention
151          case "p":
152        case "ul":        case "ul":
153        case "ol":        case "ol":
154        case "dl":        case "dl":
       case "div":  
         $e = 0;  
         // stack counter  
         $j = 1;  
   
         // if $j = 0 then stack is empty  
         while ($j > 0) {  
           $e += strpos(substr($text, $i+$e) , $tag);  
   
           // yeah I know I'm assuming certain sizes for tags, sue me  
           // new nested block  
           if ($text[$i+$e-1] == '<') {  
             ++$j;  
           }  
           // end of block  
           else if ($text[$i+$e-1] == '/') {  
             --$j;  
           }  
           // skip current tag  
           $e += 2;  
         }  
   
         $content = substr($text, $i+1, $e);  
         $output .= _get_dir(strip_tags($content));  
         $e += strlen($tag);  
         $output.= substr($text, $i, $e);  
         $i += $e;  
         break;  
   
       // block elements these get out attention  
       case "p":  
       case "blockquote":  
155        case "pre":        case "pre":
156        case "h1":        case "h1":
157        case "h2":        case "h2":

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

  ViewVC Help
Powered by ViewVC 1.1.2