Edgewall Software
Modify

Opened 19 years ago

Closed 19 years ago

Last modified 17 years ago

#1430 closed defect (invalid)

Code Colouring Not Applied For Revision

Reported by: chris@… Owned by: Jonas Borgström
Priority: lowest Milestone:
Component: version control/browser Version: devel
Severity: minor Keywords: colourize code links
Cc: chris@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

I'm not sure if this is a feature or not but when I clicked on the previous revision of my source code it failed to colourize the code. Here is what I was able to deduce:

/trac/file/trunk/helloworld.c ⇐= Colourized /trac/file/trunk/helloworld.c/?rev=3 ⇐= Not Colourized

But helloworld.c?rev=3 is, notice no slash after the filename in the URL.

I don't know how I got a link with a slash in it - the revision log seems to use the slash after the file - but this took me to the non-colorized version.

Chris

Attachments (2)

Browser_get_path_links.patch (484 bytes ) - added by chris@… 19 years ago.
Patch to stop slashes from being appended to the links. This is breaking syntax highlighting.
Browser_get_path_links1.patch (484 bytes ) - added by chris@… 19 years ago.
A silly mistake, trying to fix the egg on my face. This should work better.

Download all attachments as: .zip

Change History (6)

by chris@…, 19 years ago

Patch to stop slashes from being appended to the links. This is breaking syntax highlighting.

comment:1 by chris@…, 19 years ago

Cc: chris@… added
Keywords: links added

I have narrowed down the problem to be with how the links are generated for the browser.

The loop was initalized with a / and then trailing slashes were added. So I simply started with a blank string and added the slash first in the loop.

I have no way to test this patch I have attached since I do not have the development version of trac running, just the stable release.

Please test and let me know if it works.

by chris@…, 19 years ago

A silly mistake, trying to fix the egg on my face. This should work better.

comment:2 by chris@…, 19 years ago

Milestone: 0.9
Version: 0.8.1devel

Ah! I should set up a devel Trac before I make more stupid mistakes. Instead of having a string of slashes at the beginning, this should work a little better.

Patch is here

     for i,part in util.enum(parts):
-        path = path + part + '/'
+        path = path + '/' + part
         links.append({

comment:3 by chris@…, 19 years ago

Resolution: invalid
Status: newclosed

Works as of [1516] which was the HEAD revision at the time of posting. Ignore an overzealous new user who just got HEAD to build. :)

comment:4 by Matthew Good, 19 years ago

Milestone: 0.9

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström 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.