Edgewall Software
Modify

Opened 18 years ago

Closed 18 years ago

#3326 closed enhancement (fixed)

Improvements to PHP highlighter

Reported by: Tim Hatch <trac@…> Owned by: Christian Boos
Priority: normal Milestone: 0.10
Component: general Version: devel
Severity: minor Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Two minor issues with the PHP highlighter (source:trunk/trac/mimeview/php.py):

  1. The output of php -sn includes _two_ junk lines at the bottom, although the second one doesn't include the trailing \n. The last line is a </code> that definitely should be stripped. That second-to-last line is a </span> which was messing up validation but apparently not caught because it didn't cause any weirdness.
  2. php -sn has this nasty tendency to close tags on the line past where it'd seem logical to close them. This causes a lot of unnecessary html code, and in the interest of sending less data over the wire, this can easily be worked around. I've modified the PHPDeuglifier to scooch the close tags up to where they belong. I'm sad to see this gotcha leave, as it's what let me find #3262.

I've tested both of these points for consistency against PHP 4.3.10-16 on Debian, 4.4.1 on Windows, and 5.1.4-p10 on Gentoo.

Attaching a patch in a sec.

Attachments (2)

mimeview-php-spans.diff (1.8 KB ) - added by Tim Hatch <trac@…> 18 years ago.
Diff against trunk@3483
mimeview-php-spans.2.diff (1.7 KB ) - added by Tim Hatch <trac@…> 18 years ago.
Diff against trunk@3486, fixed line endings

Download all attachments as: .zip

Change History (4)

by Tim Hatch <trac@…>, 18 years ago

Attachment: mimeview-php-spans.diff added

Diff against trunk@3483

by Tim Hatch <trac@…>, 18 years ago

Attachment: mimeview-php-spans.2.diff added

Diff against trunk@3486, fixed line endings

comment:1 by Christian Boos, 18 years ago

Milestone: 0.10
Owner: changed from Jonas Borgström to Christian Boos
Status: newassigned

Patch looks fine.

comment:2 by Christian Boos, 18 years ago

Resolution: fixed
Status: assignedclosed

Applied in r3488, thanks!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.