cvs: phpdoc /scripts html_syntax.php

From: Date: Sat, 03 Feb 2007 19:35:46 +0000
Subject: cvs: phpdoc /scripts html_syntax.php
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969375209@lists.php.net to get a copy of this message
didou Sat Feb 3 19:35:46 2007 UTC Modified files: /phpdoc/scripts html_syntax.php Log: Use CSS defs http://cvs.php.net/viewvc.cgi/phpdoc/scripts/html_syntax.php?r1=1.9&r2=1.10&diff_format=u Index: phpdoc/scripts/html_syntax.php diff -u phpdoc/scripts/html_syntax.php:1.9 phpdoc/scripts/html_syntax.php:1.10 --- phpdoc/scripts/html_syntax.php:1.9 Sat Feb 3 19:03:35 2007 +++ phpdoc/scripts/html_syntax.php Sat Feb 3 19:35:46 2007 @@ -40,15 +40,6 @@ } function callback_highlight_xml($matches) { - $color = array( - 'attributes' => '#333366', - 'tags' => '#000066', - 'comment' => '#666666', - 'keyword' => '#cc6600', - 'string' => '#006600', - 'cdata' => '#990000', - ); - $source = htmlentities($matches[1]); $match = array( @@ -62,19 +53,18 @@ '/&lt;!\[CDATA\[(.*)\]\]&gt;/i', ); - $replace = array( - '<span style="color: ' .$color['attributes']. '">$1</span>=<span style="color: ' .$color['string']. '">$2$3$2</span>', - '<span style="color: ' .$color['tags']. ';">!DOCTYPE</span> <span style="color: ' .$color['attributes']. '">$1 $2 $3$4$3</span>', - '&lt;<span style="color: ' .$color['tags']. ';">$1</span>', - '&lt;/<span style="color: ' .$color['tags']. ';">$1</span>&gt;', - '<span style="color: ' .$color['comment']. '"><!--', + '<span class="attributes">$1</span>=<span class="string">$2$3$2</span>', + '<span class="tags">!DOCTYPE</span> <span class="attributes">$1 $2 $3$4$3</span>', + '&lt;<span class="tags">$1</span>', + '&lt;/<span class="tags">$1</span>&gt;', + '<span class="comment"><!--', '--&gt;</span>', - '&lt;<span style="color: ' .$color['tags']. ';">?xml</span> $1 <span style="color: ' .$color['tags']. ';">?</span>&gt;', - '<span style="color: ' .$color['tags']. ';">&lt;![<span style="color: ' . $color['keyword']. '">CDATA</span>[</span><span style="color: ' .$color['cdata']. ';">$1</span><span style="color: ' .$color['tags']. ';">]]&gt;</span>' + '&lt;<span class="tags">?xml</span> $1 <span class="tags">?</span>&gt;', + '<span class="tags">&lt;![<span class="keyword">CDATA</span>[</span><span class="cdata">$1</span><span class="tags">]]&gt;</span>' ); - return preg_replace($match, $replace, $source); + return '<div class="xmlcode">' . preg_replace($match, $replace, $source) . '</div>'; } $files = $_SERVER["argv"];

« previous php.doc (#969375209) next »