equal
deleted
inserted
replaced
102 if ( !$did_header_tweak ) |
102 if ( !$did_header_tweak ) |
103 { |
103 { |
104 $did_header_tweak = true; |
104 $did_header_tweak = true; |
105 global $template; |
105 global $template; |
106 $template->add_header('<style type="text/css"> |
106 $template->add_header('<style type="text/css"> |
107 .geshi_highlighted { |
|
108 max-height: 1000000px !important; |
|
109 width: 600px !important; |
|
110 clip: rect(0px,auto,auto,0px); |
|
111 overflow: auto; |
|
112 } |
|
113 .geshi_highlighted a { |
107 .geshi_highlighted a { |
114 background-image: none !important; |
108 background-image: none !important; |
115 padding-right: 0 !important; |
109 padding-right: 0 !important; |
116 } |
110 } |
117 </style> |
111 </style> |
125 foreach ( $codeblocks as $i => $match ) |
119 foreach ( $codeblocks as $i => $match ) |
126 { |
120 { |
127 $lang =& $match['lang']; |
121 $lang =& $match['lang']; |
128 $code =& $match['code']; |
122 $code =& $match['code']; |
129 |
123 |
130 $geshi = new GeSHi(trim($code), $lang, null); |
124 $geshi = new GeSHi(trim($code, "\r\n"), $lang, null); |
131 $geshi->set_header_type(GESHI_HEADER_PRE); |
125 $geshi->set_header_type(GESHI_HEADER_PRE); |
132 // $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS); |
126 // $geshi->enable_line_numbers(GESHI_FANCY_LINE_NUMBERS); |
133 $geshi->set_overall_class('geshi_highlighted'); |
127 $geshi->set_overall_class('geshi_highlighted'); |
134 $parsed = $geshi->parse_code(); |
128 $parsed = $geshi->parse_code(); |
135 |
129 |