<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Source Code Syntax Highlighting in PHP</title>
	<atom:link href="http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/feed/" rel="self" type="application/rss+xml" />
	<link>http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/</link>
	<description>Faith, Technology and Randomness in Life, According to Scott</description>
	<lastBuildDate>Tue, 06 Jul 2010 06:06:37 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: armenian chat</title>
		<link>http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/comment-page-1/#comment-1886</link>
		<dc:creator>armenian chat</dc:creator>
		<pubDate>Sat, 01 Jan 2005 18:22:45 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/#comment-1886</guid>
		<description>I am having trouble getting the whole enscript to work on my site, half the time it doesn&#039;t even highlight the code correctly. :/</description>
		<content:encoded><![CDATA[<p>I am having trouble getting the whole enscript to work on my site, half the time it doesn&#8217;t even highlight the code correctly. :/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Craig</title>
		<link>http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/comment-page-1/#comment-1876</link>
		<dc:creator>Craig</dc:creator>
		<pubDate>Tue, 28 Dec 2004 09:31:54 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/#comment-1876</guid>
		<description>David, you can just enscript -q -p OUTPUTFILE --language=html --color INPUTFILE</description>
		<content:encoded><![CDATA[<p>David, you can just enscript -q -p OUTPUTFILE &#8211;language=html &#8211;color INPUTFILE</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SCSween</title>
		<link>http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/comment-page-1/#comment-122</link>
		<dc:creator>SCSween</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/#comment-122</guid>
		<description>This seems cool.  And I was searching for this capability in ViewCVS.  Incidentally, www.horde.org has Chora CVS viewer, which highlights php syntax.  But I am using ViewCVS.

Now, how does ViewCVS call your script?  Do you have doco on that hack?</description>
		<content:encoded><![CDATA[<p>This seems cool.  And I was searching for this capability in ViewCVS.  Incidentally, <a href="http://www.horde.org" rel="nofollow">http://www.horde.org</a> has Chora CVS viewer, which highlights php syntax.  But I am using ViewCVS.</p>
<p>Now, how does ViewCVS call your script?  Do you have doco on that hack?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: designcurve</title>
		<link>http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/comment-page-1/#comment-123</link>
		<dc:creator>designcurve</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/#comment-123</guid>
		<description>&quot;Now, how does ViewCVS call your script? Do you have doco on that hack?&quot;

ViewCVS does not call this code. This is merely an example of how to perform syntax highlighting of several languages with PHP.

BTW: I am using a similar setup to highlight my code snippets on my site (http://www.designcurve.net/snippets/).

--DesignCurve</description>
		<content:encoded><![CDATA[<p>&#8220;Now, how does ViewCVS call your script? Do you have doco on that hack?&#8221;</p>
<p>ViewCVS does not call this code. This is merely an example of how to perform syntax highlighting of several languages with PHP.</p>
<p>BTW: I am using a similar setup to highlight my code snippets on my site (<a href="http://www.designcurve.net/snippets/" rel="nofollow">http://www.designcurve.net/snippets/</a>).</p>
<p>&#8211;DesignCurve</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthias Ragaz</title>
		<link>http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/comment-page-1/#comment-124</link>
		<dc:creator>Matthias Ragaz</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/#comment-124</guid>
		<description>Just what I was looking for. I just couldn&#039;t put together all the pieces myself. I too discovered enscript in connection with ViewCVS.</description>
		<content:encoded><![CDATA[<p>Just what I was looking for. I just couldn&#8217;t put together all the pieces myself. I too discovered enscript in connection with ViewCVS.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Skeet</title>
		<link>http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/comment-page-1/#comment-125</link>
		<dc:creator>Skeet</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/#comment-125</guid>
		<description>Doesn&#039;t this work if php safe mode is enabled?
(Warning: show_source(): SAFE MODE Restriction in effect.)</description>
		<content:encoded><![CDATA[<p>Doesn&#8217;t this work if php safe mode is enabled?<br />
(Warning: show_source(): SAFE MODE Restriction in effect.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Mostafa</title>
		<link>http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/comment-page-1/#comment-126</link>
		<dc:creator>Joshua Mostafa</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/#comment-126</guid>
		<description>The regexp that turns font tags into spans is broken. You close with  instead of with .

Neither do you need to use two regexps - of which the second should be an str_replace ... but you can do it all with a single regexp. I&#039;ve tried a couple of times to post my version of that bit but the form keeps eating the patterns - presuming thinking they&#039;re HTML. I&#039;ll try again with &gt; and &lt; instead of plain &gt; and &lt; ...

$pattern = &#039;/&lt;FONT COLOR=&quot;\([^&quot;]*)&quot;&gt;.*?&lt;\/FONT&gt;/&#039;;
$buffer = preg_replace ($pattern, &#039;&lt;span style=&quot;color:\1&quot;&gt;\2?&lt;\/span&gt;&#039;, $buffer);

Nice, it works. Go the preview!! :)</description>
		<content:encoded><![CDATA[<p>The regexp that turns font tags into spans is broken. You close with  instead of with .</p>
<p>Neither do you need to use two regexps &#8211; of which the second should be an str_replace &#8230; but you can do it all with a single regexp. I&#8217;ve tried a couple of times to post my version of that bit but the form keeps eating the patterns &#8211; presuming thinking they&#8217;re HTML. I&#8217;ll try again with &amp;gt; and &amp;lt; instead of plain &gt; and &lt; &#8230;</p>
<p>$pattern = &#8216;/&lt;FONT COLOR=&#8221;\([^"]*)&#8221;&gt;.*?&lt;\/FONT&gt;/&#8217;;<br />
$buffer = preg_replace ($pattern, &#8216;&lt;span style=&#8221;color:\1&#8243;&gt;\2?&lt;\/span&gt;&#8217;, $buffer);</p>
<p>Nice, it works. Go the preview!! :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joshua Mostafa</title>
		<link>http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/comment-page-1/#comment-127</link>
		<dc:creator>Joshua Mostafa</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/#comment-127</guid>
		<description>Ahem ... it also ate some of my post ... what I was trying to say earlier was that:
&#039;You close with &lt;/style&gt; instead of &lt;/span&gt;&#039;

.. I guess you have something that eats HTML tags on your site? Maybe it would make more sense to just go:

$post = str_replace (&#039;&lt;&#039;, &#039;&lt;&#039;, $post);
$post = str_replace (&#039;&gt;&#039;, &#039;&gt;&#039;, $post);</description>
		<content:encoded><![CDATA[<p>Ahem &#8230; it also ate some of my post &#8230; what I was trying to say earlier was that:<br />
&#8216;You close with &lt;/style&gt; instead of &lt;/span&gt;&#8217;</p>
<p>.. I guess you have something that eats HTML tags on your site? Maybe it would make more sense to just go:</p>
<p>$post = str_replace (&#8216;&lt;&#8217;, &#8216;&amp;lt;&#8217;, $post);<br />
$post = str_replace (&#8216;&gt;&#8217;, &#8216;&amp;gt;&#8217;, $post);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/comment-page-1/#comment-128</link>
		<dc:creator>David</dc:creator>
		<pubDate>Wed, 30 Nov -0001 00:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://scott.yang.id.au/2003/01/source-code-syntax-highlighting-in-php/#comment-128</guid>
		<description>Just fyi, there&#039;s a color-code / syntax-highlighting text editor for Windows called ConTEXT -- although it&#039;s pretty simple (just goes through the syntax and encapsulates words with font-color tags), it features exporting to static HTML, which may be more preferable than always calling a server-intensive dynamic script.

Just my two cents (^_^)
</description>
		<content:encoded><![CDATA[<p>Just fyi, there&#8217;s a color-code / syntax-highlighting text editor for Windows called ConTEXT &#8212; although it&#8217;s pretty simple (just goes through the syntax and encapsulates words with font-color tags), it features exporting to static HTML, which may be more preferable than always calling a server-intensive dynamic script.</p>
<p>Just my two cents (^_^)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
