Summary | MIME_Viewer_source::lineNumber |
Queue | Horde Base |
Queue Version | 3.0.5 |
Type | Bug |
State | Duplicate |
Priority | 1. Low |
Owners | Horde Developers (at) |
Requester | mboerger (at) ford (dot) com |
Created | 08/10/2005 (7241 days ago) |
Due | |
Updated | 02/25/2006 (7042 days ago) |
Assigned | 08/31/2005 (7220 days ago) |
Resolved | 02/25/2006 (7042 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
State ⇒ Duplicate
bug 3038.State ⇒ Assigned
i am now no longer able to copy the source and have to srip out the
line numbers of the page.
My original problem is that the lines and line number get out of synch
(hight wise).
regards
marcus (helly)
State ⇒ Feedback
the idea of the line numbering is to *not* use a table row for every
line. That would explode the page sizes. What exactly is not working
for you?
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ MIME_Viewer_source::lineNumber
Queue ⇒ Horde Base
are treated differently. The solution is to change the method as
follows:
/**
* Add line numbers to a block of code.
*
* @param string $code The code to number.
*/
function lineNumber($code, $linebreak = "\n")
{
$code = explode($linebreak, $code);
$html = '<!--a75c305b1c0a6022--><table style="border: 1px
solid black" cellspacing="0" cellpadding="0" width="100%">';
foreach($code as $l => $text) {
$html .= '<tr><td valign="top"
style="background-color:#e9e9e9; padding-left:10px;
padding-right:10px; text-align:right; font-family:monospace;
font-size:12px;">';
$html .= sprintf('<a style="font-family:monospace;
font-size:12px;" name="%s" href="#%s">%s</a>', $l, $l, $l) . '</td>';
$html .= '<td width="100%" valign="top" nowrap="nowrap"
style="background-color:white; padding-left:10px;
font-family:monospace; font-size:12px;">' . $text . '</td>';
$html .= '</tr>';
}
return $html . '</table>';
}