[patch] highlight_[file|string] and line numbers
| From: | Johannes Schlueter | Date: | Sat, 12 Mar 2005 23:16:14 +0000 |
| Subject: | [patch] highlight_[file|string] and line numbers | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-15407@lists.php.net to get a copy of this message | ||
Hi,
some days (or even weeks?) ago Lukas asked on IRC wether there is a way to get
PHP code highlighted with linenumbers. The first reaction of most people
(including me) was "no" since you can't copy&paste the code but after
thinking I found out that <ol> works really fine. So I've implemented it that
way and added an optional bool parameter to the highlight functions.
Additionally I've added two other parameters to these functions: The first
one is a bool that adds jump targets (<a id="[line]"/>), second one is a
prefix to this number (<a id="[prefix][line]"/>) which is needed to make sure
the jump target is unique even if more than one snippet is added to the
output.
This doesn't work with .phps yet since we would a new php.ini setting which I
didn't want to add or numbered output would need to become default.
My patch is attached and, if it doesn't come through, available on
http://www.schlueters.de/zend_highlight_20050312_1.diff
a sample output is at
http://www.schlueters.de/highlight_pma.html
johannes
--
Johannes Schlüter Mayflower GmbH / ThinkPHP
http://thinkphp.de http://blog.thinkphp.de
Attachment: [text/x-diff] zend_highlight_20050312_1.diff
Attachment: [text/x-diff] zend_highlight_20050312_1.diff