syntax highlighting does not work when user is logged in ...

15 views
Skip to first unread message

drastrogeek

unread,
Mar 31, 2016, 9:48:51 AM3/31/16
to Trac Users
I'm using trac version 1.0.2, just the build that comes with Fedora 21, and noticed something strange. Syntax highlighting works perfectly well on code snippets for general users, that do not physically log in to the site. However, when you log in, so you can modify tickets and such, all of a sudden that doesn't work anymore. Doesn't matter which browser I use, Safari, Firefox or Chrome, they all exhibit the same behavior. Any ideas why that is?

RjOllos

unread,
Mar 31, 2016, 12:32:09 PM3/31/16
to Trac Users
On Thursday, March 31, 2016 at 6:48:51 AM UTC-7, drastrogeek wrote:
I'm using trac version 1.0.2, just the build that comes with Fedora 21, and noticed something strange. Syntax highlighting works perfectly well on code snippets for general users, that do not physically log in to the site. However, when you log in, so you can modify tickets and such, all of a sudden that doesn't work anymore. Doesn't matter which browser I use, Safari, Firefox or Chrome, they all exhibit the same behavior. Any ideas why that is?

I can reproduce by setting the pygments_style in session_attributes to NULL. In that case, navigating to /prefs/pygments, the first pygments style in the list is selected ("Algol") and there is no syntax highlighting in the sample. The issue is fixed by setting the style and //Apply Changes//.

 


If you find the same behavior on your site, the next question to explore is how to pygments_style was set to NULL for authenticated users.


- Ryan

RjOllos

unread,
Apr 4, 2016, 9:35:02 AM4/4/16
to Trac Users


On Thursday, March 31, 2016 at 12:32:09 PM UTC-4, RjOllos wrote:

If you find the same behavior on your site, the next question to explore is how to pygments_style was set to NULL for authenticated users.


If you have time and are able to fix the issue, please let us know what you find. I'm interested to know if/how the entries in your session_attributes table became null, so I can explore possible changes to Trac that could make it more robust.

Thanks,
- Ryan 
Reply all
Reply to author
Forward
0 new messages