Changeset 1162 for trunk/vendor/Text
- Timestamp:
- 03/05/07 12:14:42 (22 months ago)
- Location:
- trunk/vendor/Text/Wiki
- Files:
-
- 3 modified
-
Parse.php (modified) (2 diffs)
-
Parse/Default/Code.php (modified) (1 diff)
-
Render/Xhtml/Code.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/vendor/Text/Wiki/Parse.php
r1125 r1162 234 234 // find the =" sections; 235 235 $tmp = explode('="', trim($text)); 236 $mark = '"'; 237 238 if (count($tmp) == 1) { 239 $tmp = explode("='", trim($text)); 240 $mark = "'"; 241 } 236 242 237 243 // basic setup … … 252 258 // the part to the left is the value for the last key, 253 259 // the part to the right is the next key name 254 $pos = strrpos($val, '"');260 $pos = strrpos($val, $mark); 255 261 $attrs[$key] = stripslashes(substr($val, 0, $pos)); 256 262 $key = trim(substr($val, $pos+1)); 257 263 258 264 } 259 260 265 return $attrs; 261 266 -
trunk/vendor/Text/Wiki/Parse/Default/Code.php
r1128 r1162 81 81 // get the attributes... 82 82 $attr = $this->getAttrs($args); 83 83 84 84 // ... and make sure we have a 'type' 85 85 if (! isset($attr['type'])) { -
trunk/vendor/Text/Wiki/Render/Xhtml/Code.php
r1128 r1162 59 59 $css_filename = $this->formatConf(' class="%s"', 'css_filename'); 60 60 61 if ($type == 'php' || true) {61 if ($type == 'php') { 62 62 if (substr($options['text'], 0, 5) != '<?php') { 63 63 // PHP code example: … … 121 121 $text = "<pre$css><code$css_html>$text</code></pre>"; 122 122 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>"; 123 131 } else { 124 132 // generic code example: