bjori           Thu Feb  1 14:51:15 2007 UTC

  Modified files:              
    /phpdoc/scripts     html_syntax.php 
    /phpdoc/phpbook/phpbook-xsl html-common.xsl 
  Log:
  Make sure we don't highlight to little
  # Fixes a bug where examples with "</pre>" in them only partly highlight
  
  
http://cvs.php.net/viewvc.cgi/phpdoc/scripts/html_syntax.php?r1=1.7&r2=1.8&diff_format=u
Index: phpdoc/scripts/html_syntax.php
diff -u phpdoc/scripts/html_syntax.php:1.7 phpdoc/scripts/html_syntax.php:1.8
--- phpdoc/scripts/html_syntax.php:1.7  Tue Jan 30 18:30:29 2007
+++ phpdoc/scripts/html_syntax.php      Thu Feb  1 14:51:15 2007
@@ -58,7 +58,7 @@
                //~ echo "$filename\n";
                $original = file_get_contents($filename);
                $highlighted = 
preg_replace_callback("!<PRE\r?\nCLASS=\"php\"\r?\n>(.*)</PRE\r?\n>!sU", 
"callback_highlight_php", $original);
-               $highlighted = preg_replace_callback("!<pre 
class=\"php\">(.*)</pre>!sU", "callback_highlight_php", $highlighted); /* XSL 
build */
+               $highlighted = 
preg_replace_callback("@<HIGHLIGHTME>(.*)</HIGHLIGHTME>@sU", 
"callback_highlight_php", $highlighted); /* XSL build */
                if ($original != $highlighted) {
                        // file_put_contents is only in PHP >= 5
                        $fp = fopen($filename, "wb");
http://cvs.php.net/viewvc.cgi/phpdoc/phpbook/phpbook-xsl/html-common.xsl?r1=1.5&r2=1.6&diff_format=u
Index: phpdoc/phpbook/phpbook-xsl/html-common.xsl
diff -u phpdoc/phpbook/phpbook-xsl/html-common.xsl:1.5 
phpdoc/phpbook/phpbook-xsl/html-common.xsl:1.6
--- phpdoc/phpbook/phpbook-xsl/html-common.xsl:1.5      Thu Feb  1 09:38:02 2007
+++ phpdoc/phpbook/phpbook-xsl/html-common.xsl  Thu Feb  1 14:51:15 2007
@@ -3,7 +3,7 @@
 
   html-common.xsl: Common HTML customizations
 
-  $Id: html-common.xsl,v 1.5 2007/02/01 09:38:02 bjori Exp $
+  $Id: html-common.xsl,v 1.6 2007/02/01 14:51:15 bjori Exp $
 
 -->
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
@@ -623,18 +623,20 @@
    <xsl:param name="suppress-numbers" select="'0'"/>
   <table xsl:use-attribute-sets="shade.verbatim.style">
     <tr>
-      <td>
-          <xsl:element name="pre">
-              <xsl:attribute name="class"><xsl:value-of select="./@role" 
/></xsl:attribute>
-              <xsl:choose>
-                  <xsl:when test="./@role = 'php'">
-                    <xsl:value-of select="." disable-output-escaping="yes" />
+        <td>
+            <xsl:choose>
+                <xsl:when test="./@role = 'php'">
+                    <xsl:element name="HIGHLIGHTME">
+                        <xsl:value-of select="." disable-output-escaping="yes" 
/>
+                    </xsl:element>
                 </xsl:when>
                 <xsl:otherwise>
-                    <xsl:value-of select="." disable-output-escaping="no" />
+                    <xsl:element name="pre">
+                      <xsl:attribute name="class"><xsl:value-of 
select="./@role" /></xsl:attribute>
+                      <xsl:value-of select="." disable-output-escaping="no" />
+                    </xsl:element>
                 </xsl:otherwise>
             </xsl:choose>
-          </xsl:element>
       </td>
     </tr>
   </table>

Reply via email to