#23253 [NEW]: highlight_string($string) removes newlines from input string

From: Date: Thu, 17 Apr 2003 07:06:09 +0000
Subject: #23253 [NEW]: highlight_string($string) removes newlines from input string
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-37792@lists.php.net to get a copy of this message
From: gk at proliberty dot com Operating system: linux PHP version: 4.3.2RC1 PHP Bug Type: Feature/Change Request Bug description: highlight_string($string) removes newlines from input string If you use highlight_string() to produce HTML formatted source, the output string replaces newlines with <br \>. This is very ugly and unnecessary. Whitespace is an important part of code; readability is not an insignificant feature. Instead, "\n" should be replaced with "<br \>\n", or "<br>\n", to be HTML compliant. <?php // $source_file includes line breaks $source=join('',file($source_file)); $body=highlight_string ( $source, $return=TRUE); // $body is a single line, without line breaks ?> -- Edit bug report at http://bugs.php.net/?id=23253&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=23253&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=23253&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=23253&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=23253&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=23253&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=23253&r=support Expected behavior: http://bugs.php.net/fix.php?id=23253&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=23253&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=23253&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=23253&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=23253&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=23253&r=dst IIS Stability: http://bugs.php.net/fix.php?id=23253&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=23253&r=gnused

« previous php.bugs (#37792) next »