Edgewall Software
Modify

Opened 15 years ago

Last modified 9 years ago

#8005 new defect

syntax coloring in existing tickets stopped working

Reported by: jhn@… Owned by:
Priority: low Milestone: unscheduled
Component: rendering Version: 0.11.2.1
Severity: minor Keywords:
Cc: jhn@… Branch:
Release Notes:
API Changes:
Internal Changes:

Description

in my install of trac, syntax coloring was working properly for me, for example:

select table_name
  from all_tables
 where owner = user
   and table_name like '%T';

however, i upgraded python from 2.5.2 to 2.5.4 and subversion (and python bindings) from 1.5.4 to 1.5.5.

now the TracSyntaxColoring for the sql blocks in existing tickets doesn't work properly. the #!sql just gets swallowed and the code just displays as the default gray block with black text.

if i hit "Preview" on such a ticket, even without making any changes, the sql gets formatted correctly. thereafter, if i refresh the ticket, it still shows with the proper formatting.

i would assume that this affects all other WikiProcessors as well.

other info:

  • windows
  • apache 2.2.8 with mod_wsgi 2.3
  • trac 0.11.2.1
  • genshi 0.5.1
  • pygments 1.0

Attachments (0)

Change History (12)

comment:1 by jhn@…, 15 years ago

Priority: normallow
Severity: normalminor

i haven't changed anything (using the same browser, google chrome; didn't even restart apache), and this is working properly again. i definitely saw it before so under certain conditions it can happen..

comment:2 by ebray, 15 years ago

Are you sure the existing tickets weren't just cached by your browser? This doesn't sound like an actual issue with Trac.

comment:3 by Christian Boos, 15 years ago

Milestone: 1.0

I think it's both an issue with the browser cache and a problem with Trac: the loading of the stylesheet in this case is done by the delayed Javascript loading of stylesheets (see trunk/trac/templates/layout.html@7800 and late_links), and this is not that robust.

For example, if a Javascript error happens before the loading code is reached, or if the browser has in the cache an old version of jQuery (for example, I've often witnessed the effect described in this ticket when switching to a newer version of jQuery).

Maybe we can do something here to improve that situation, like ensuring that the jQuery.loadStyleSheet is our first javascript code executed, and maybe also do something on the level of the cache headers associated with jquery.js.

in reply to:  2 comment:4 by jhn@…, 15 years ago

Replying to ebray:

i explicitly refreshed the page when i was seeing this behavior and it didn't clear it up. not until i hit the preview button did the syntax coloring start working.

comment:5 by Christian Boos, 14 years ago

Milestone: 1.0unscheduled

Milestone 1.0 deleted

in reply to:  3 ; comment:6 by Remy Blank, 14 years ago

Replying to cboos:

I think it's both an issue with the browser cache and a problem with Trac: the loading of the stylesheet in this case is done by the delayed Javascript loading of stylesheets (see trunk/trac/templates/layout.html@7800 and late_links), and this is not that robust.

Why do we do delayed loading of CSS (as opposed to <link> tags)?

in reply to:  6 comment:7 by Christian Boos, 14 years ago

Why do we do delayed loading of CSS (as opposed to <link> tags)?

As the wiki_to... calls are performed in the Genshi templates, the <HEAD> element has already been generated at the time the wiki processors add stylesheets.

See attachment:wiki2x_in_templates.2.diff:wiki:ChristopherLenz and the Trac-dev thread linked from there, for more details.

comment:8 by Remy Blank, 14 years ago

Thanks for the reference. So that means our claim to degrade gracefully in the absence of JavaScript is a bit… overstated? I see the effect every day in the RSS feed reader of Thunderbird, where syntax highlighting doesn't work (this is especially bad with patches).

comment:9 by Christian Boos, 14 years ago

Milestone: triagingunscheduled

Milestone triaging deleted

comment:10 by akliewer99@…, 11 years ago

March 11, 2013 - Just upgraded my trac from 0.12.3 to 1.0 at http://tracs.iskymarshall.com/ism

This really messed up my CSS design'''

In the layout.html page I commenting out the line loading the JQuery.loadStyleSheet. It was the only way to get my custom css to work.

Can the JQuery.loadStyleSheet be moved up on the page? I don't know genshi very well. But I think it would work.

Please review the priority of this ticket. I lost a few hours tracking this down.

— akliewer99 ;)

SYSTEM DETAILS:

  • Mac OSX 10.6.8 Server
  • Perl 5, version 16
  • Subversion v5.16.0
  • Python 2.6.1
  • Setuptools 0.6c11
  • Docutils 0.10
  • Genshi 0.6
  • Pygments 1.5
  • Trac 1.0

comment:11 by timograham@…, 9 years ago

I can reproduce what I believe is this issue as described in https://github.com/django/code.djangoproject.com/issues/53 (Trac 1.0.6).

in reply to:  11 comment:12 by Jun Omae, 9 years ago

Replying to timograham@…:

I can reproduce what I believe is this issue as described in https://github.com/django/code.djangoproject.com/issues/53 (Trac 1.0.6).

Diff text on auto-preview issue has been fixed in #10674.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


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