[Trac] solution - SilverCity javascript syntax highlighting

zwetan zwetan at gmail.com
Mon Oct 31 18:31:30 CST 2005


hi,
on some older post
I asked about a problem I got with Enscript /Silvercity etc..
not being able to highlight some js code

now I nailed the problem :)

so for people who could be interested here the thing

my goal was to highlight *.js files
not some js embeded inside HTML files

and as the current setup of Trac It can not be done
here why:

trac/mimeview/api.py
-----------------------------------
MIME_MAP = {
...
    'js':'text/x-javascript',
...
}
-----------------------------------

trac/mimeview/silvercity.py
-----------------------------------
types = {
...
    'application/x-javascript':['CPP'], # Kludgy.
...
}
-----------------------------------

so to solve the problem just modify silvercity.py to

trac/mimeview/silvercity.py
-----------------------------------
types = {
...
    'text/x-javascript':['CPP'], # Kludgy.
...
}
-----------------------------------

and boom it's working...

this is a bug right ?

zwetan


More information about the Trac mailing list