Re: cvs: peardoc / colorize.php

From: Date: Thu, 30 Oct 2003 13:51:51 +0000
Subject: Re: cvs: peardoc / colorize.php
References: 1 2  Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-1826@lists.php.net to get a copy of this message
Hi Dennis, The code that looks wrong has been there for years. Only the lines with + in front of them were added. The reason it is written this way is that the dsssl that transforms docbook to html has this (annoying) habit of making tags look like this <PRE CLASS="php"> </PRE
Try a view source on the pages and you will see the abomination that is docbook tranformed to html :) Greg Dennis Sterzenbach wrote:
     highlight_string($example);
     $colored_example = ob_get_contents();
     ob_end_clean();
+    +    // add \n to fix highlight_string() for cut-and-pasting examples
+    $colored_example = str_replace('<br />', "\n", $colored_example);
      return '<PRE CLASS="php">' . $colored_example . '</PRE';
}
For me there's missing the closing bracket to </PRE in return statement?


« previous php.pear.doc (#1826) next »