Some issues fixed
parent
3c108ae57e
commit
6236f57500
|
|
@ -18,12 +18,17 @@ class kodrs extends plugins {
|
|||
|
||||
function source_code_beautifier() {
|
||||
global $rows;
|
||||
|
||||
$text = $rows[0]['Body'];
|
||||
$result = preg_replace_callback("/<code\s+.*lang\s*=\"(.*)\">(.*)<\/code>/siU",
|
||||
foreach($rows as $key=>$post){
|
||||
// Si no es tipo 'post' entonces no tiene 'Body' :)
|
||||
if($post["postType"]=="post"){
|
||||
$text = $rows[$key]['Body'];
|
||||
$result = preg_replace_callback("/<code\s+.*lang\s*=\"(.*)\">(.*)<\/code>/siU",
|
||||
array('kodrs', 'replace_with_geshi'),
|
||||
$text);
|
||||
$rows[0]['Body'] = $result;
|
||||
$text
|
||||
);
|
||||
$rows[$key]['Body'] = $result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static function replace_with_geshi($matches) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue