Changeset 1162 for trunk/vendor/Text

Show
Ignore:
Timestamp:
03/05/07 12:14:42 (22 months ago)
Author:
zYne
Message:
 
Location:
trunk/vendor/Text/Wiki
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/vendor/Text/Wiki/Parse.php

    r1125 r1162  
    234234        // find the =" sections; 
    235235        $tmp = explode('="', trim($text)); 
     236        $mark = '"'; 
     237 
     238        if (count($tmp) == 1) { 
     239            $tmp = explode("='", trim($text)); 
     240            $mark = "'"; 
     241        } 
    236242 
    237243        // basic setup 
     
    252258            // the part to the left is the value for the last key, 
    253259            // the part to the right is the next key name 
    254             $pos = strrpos($val, '"'); 
     260            $pos = strrpos($val, $mark); 
    255261            $attrs[$key] = stripslashes(substr($val, 0, $pos)); 
    256262            $key = trim(substr($val, $pos+1)); 
    257263 
    258264        } 
    259  
    260265        return $attrs; 
    261266 
  • trunk/vendor/Text/Wiki/Parse/Default/Code.php

    r1128 r1162  
    8181                // get the attributes... 
    8282                $attr = $this->getAttrs($args); 
    83                  
     83 
    8484                // ... and make sure we have a 'type' 
    8585                if (! isset($attr['type'])) { 
  • trunk/vendor/Text/Wiki/Render/Xhtml/Code.php

    r1128 r1162  
    5959        $css_filename = $this->formatConf(' class="%s"', 'css_filename'); 
    6060 
    61         if ($type == 'php' || true) { 
     61        if ($type == 'php') { 
    6262            if (substr($options['text'], 0, 5) != '<?php') { 
    6363                // PHP code example: 
     
    121121            $text = "<pre$css><code$css_html>$text</code></pre>"; 
    122122 
     123        } elseif ($type == 'sql') { 
     124            // HTML code example: 
     125            // add <html> opening and closing tags, 
     126            // convert tabs to four spaces, 
     127            // convert entities. 
     128            $text = str_replace("\t", "    ", $text); 
     129            $text = $this->textEncode($text); 
     130            $text = "<div class='sql'>$text</div>"; 
    123131        } else { 
    124132            // generic code example: