[pLog-svn] r6847 - in plugins/branches/lifetype-1.2/plogeshi: . class/plogeshi

pwestbro at devel.lifetype.net pwestbro at devel.lifetype.net
Wed Apr 1 14:30:23 EDT 2009


Author: pwestbro
Date: 2009-04-01 14:30:23 -0400 (Wed, 01 Apr 2009)
New Revision: 6847

Modified:
   plugins/branches/lifetype-1.2/plogeshi/class/plogeshi/plogeshi.class.php
   plugins/branches/lifetype-1.2/plogeshi/pluginplogeshi.class.php
Log:
Thanks to soak for the fix.  

Now the plogeshi plugin handles the valid html syntax (ie <code x=x> .... </code>


Modified: plugins/branches/lifetype-1.2/plogeshi/class/plogeshi/plogeshi.class.php
===================================================================
--- plugins/branches/lifetype-1.2/plogeshi/class/plogeshi/plogeshi.class.php	2009-03-27 17:48:54 UTC (rev 6846)
+++ plugins/branches/lifetype-1.2/plogeshi/class/plogeshi/plogeshi.class.php	2009-04-01 18:30:23 UTC (rev 6847)
@@ -5,6 +5,8 @@
 	
 		function colorText ( $text )
 		{
+
+			$text=preg_replace('/<code\s+(\w+)=\"(\w+)\"/ixsm', '<code $1', $text );
 			return $this->parse( $text );
 		}
 	
@@ -238,4 +240,4 @@
 	
 	
 	}
-?>
\ No newline at end of file
+?>

Modified: plugins/branches/lifetype-1.2/plogeshi/pluginplogeshi.class.php
===================================================================
--- plugins/branches/lifetype-1.2/plogeshi/pluginplogeshi.class.php	2009-03-27 17:48:54 UTC (rev 6846)
+++ plugins/branches/lifetype-1.2/plogeshi/pluginplogeshi.class.php	2009-04-01 18:30:23 UTC (rev 6847)
@@ -19,7 +19,7 @@
             // set some information
             // ---
             $this->id = "plogeshi";
-            $this->version = "20070226";
+            $this->version = "20090401";
             $this->author = "Rodrigo Pérez (bilson)";
             $this->desc = "This plugin allows to color bits of code using GeSHi. Please use the following syntax
                           anywhere in your posts:<br/><br/>
@@ -97,14 +97,16 @@
             // This code really should be looking at the text for the 
             // <code > tag
           
-		    $postText = trim($post);
+	    $post=preg_replace('/<code\s+(\w+)=\"(\w+)\"/ixsm', '<code $1', $post );
+	    
+	    $postText = trim($post);
 
-		    if ( !preg_match( "/<code\s+\w+\s*>/i", $post ) ||
-        		 !preg_match( "/<\/code>/", $post ) ) {
+	    if ( !preg_match( "/<code\s+\w+\s*>/i", $post ) ||
+       	         !preg_match( "/<\/code>/", $post ) ) {
         		return false;
-    		} else {
-        		return( strlen($postText) > 0 );
-    		}	
+    	    } else {
+        	return( strlen($postText) > 0 );
+    	    }	
         }
         
         /**
@@ -147,4 +149,4 @@
 		}
 
     }
-?>
\ No newline at end of file
+?>



More information about the pLog-svn mailing list