Changeset 1651 for trunk/vendor/Text
- Timestamp:
- 06/12/07 23:18:21 (19 months ago)
- Location:
- trunk/vendor/Text/Wiki/Render/Xhtml
- Files:
-
- 5 modified
-
Bold.php (modified) (1 diff)
-
Code.php (modified) (5 diffs)
-
Italic.php (modified) (1 diff)
-
Underline.php (modified) (1 diff)
-
Url.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/vendor/Text/Wiki/Render/Xhtml/Bold.php
r1125 r1651 47 47 if ($options['type'] == 'start') { 48 48 $css = $this->formatConf(' class="%s"', 'css'); 49 return "< b$css>";49 return "<strong$css>"; 50 50 } 51 51 52 52 if ($options['type'] == 'end') { 53 return '</ b>';53 return '</strong>'; 54 54 } 55 55 } -
trunk/vendor/Text/Wiki/Render/Xhtml/Code.php
r1162 r1651 60 60 61 61 if ($type == 'php') { 62 62 63 if (substr($options['text'], 0, 5) != '<?php') { 63 64 // PHP code example: 64 65 // add the PHP tags 65 $text = "<?php 66 " . $options['text'] . "\n?>"; // <?php 66 $text = "<?php \n" 67 . $options['text'] . "\n\n" 68 . "?>"; 67 69 } 68 70 69 71 // convert tabs to four spaces 70 $text = str_replace("\t", " %nbsp; ", $text);72 $text = str_replace("\t", " ", $text); 71 73 72 74 // colorize the code block (also converts HTML entities and adds 73 75 // <code>...</code> tags) 74 $h = new PHP_Highlight ;76 $h = new PHP_Highlight(true); 75 77 $h->loadString($text); 76 78 $text = $h->toHtml(true); 77 79 78 80 // replace <br /> tags with simple newlines. 79 81 // replace non-breaking space with simple spaces. 80 82 // translate HTML <font> and color to XHTML <span> and style. 81 83 // courtesy of research by A. Kalin :-). 82 /**84 83 85 $map = array( 84 ' <br />' => "\n",85 ' ' => ' ',86 "\n" => "<br \>",87 '<font' => '<span',88 '</font>' => '</span>',89 'color="' => 'style="color:'86 ' ' => ' ' 87 //'<br />' => "\n", 88 //"\n" => "<br \>", 89 //'<font' => '<span', 90 //'</font>' => '</span>', 91 //'color="' => 'style="color:' 90 92 ); 91 93 92 94 $text = strtr($text, $map); 93 */94 95 95 96 // get rid of the last newline inside the code block … … 105 106 106 107 // done 107 $text = "<table border=1 class='dashed' cellpadding=0 cellspacing=0>108 /*$text = "<table border=1 class='dashed' cellpadding=0 cellspacing=0> 108 109 <tr><td><b>$text 109 110 </b></td></tr> 110 </table>"; 111 </table>";*/ 111 112 112 113 } elseif ($type == 'html' || $type == 'xhtml') { … … 117 118 // convert entities. 118 119 $text = str_replace("\t", " ", $text); 119 $text = "<html>\n$text\n</html>";120 //$text = "<html>\n$text\n</html>"; 120 121 $text = $this->textEncode($text); 121 $text = "<pre$css> <code$css_html>$text</code></pre>";122 $text = "<pre$css>$text</pre>"; 122 123 123 124 } elseif ($type == 'sql') { … … 128 129 $text = str_replace("\t", " ", $text); 129 130 $text = $this->textEncode($text); 130 $text = "< div class='sql'>$text</div>";131 $text = "<pre class=\"sql\">$text</pre>"; 131 132 } else { 132 133 // generic code example: … … 135 136 $text = str_replace("\t", " ", $text); 136 137 $text = $this->textEncode($text); 137 $text = "<pre$css> <code$css_code>$text</code></pre>";138 $text = "<pre$css>$text</pre>"; 138 139 } 139 140 -
trunk/vendor/Text/Wiki/Render/Xhtml/Italic.php
r1125 r1651 47 47 if ($options['type'] == 'start') { 48 48 $css = $this->formatConf(' class="%s"', 'css'); 49 return "< i$css>";49 return "<em$css>"; 50 50 } 51 51 52 52 if ($options['type'] == 'end') { 53 return '</ i>';53 return '</em>'; 54 54 } 55 55 } -
trunk/vendor/Text/Wiki/Render/Xhtml/Underline.php
r1125 r1651 47 47 if ($options['type'] == 'start') { 48 48 $css = $this->formatConf(' class="%s"', 'css'); 49 return "< u$css>";49 return "<span style=\"text-decoration: underline;\"$css>"; 50 50 } 51 51 52 52 if ($options['type'] == 'end') { 53 return '</ u>';53 return '</span>'; 54 54 } 55 55 } -
trunk/vendor/Text/Wiki/Render/Xhtml/Url.php
r1125 r1651 94 94 $output = "<a$css href=\"$href\""; 95 95 96 /* 96 97 if ($target) { 97 98 // use a "popup" window. this is XHTML compliant, suggested by … … 101 102 $output .= " return false;\""; 102 103 } 104 */ 103 105 104 106 // finish up output