Re: [Trac] Re: When viewing a source ".c" file, Trac 1.5.4 shows it as an image

2022-05-20 Thread Jun Omae
On Wed, May 18, 2022 at 9:20 AM Dan wrote: > > It looks like this issue is due to pygments.lexers.get_all_lexers() having > multiple mime types associated with this extension. > > ('C', ('c',), ('*.c', '*.h', '*.idc', '*.x[bp]m'), ('text/x-chdr', > 'text/x-csrc', 'image/x-xbitmap',

Re: [Trac] Re: When viewing a source ".c" file, Trac 1.5.4 shows it as an image

2022-05-19 Thread Dan
Thanks! Interestingly I didn't see your first reply, and I'm still not sure where that one went. But thanks again for going ahead with the ticket. - Dan On Thursday, May 19, 2022 at 8:22:56 AM UTC-5 Jun Omae wrote: > On Wed, May 18, 2022 at 10:35 AM Jun Omae wrote: > > > > On Wed, May 18,

Re: [Trac] Re: When viewing a source ".c" file, Trac 1.5.4 shows it as an image

2022-05-19 Thread Jun Omae
On Wed, May 18, 2022 at 10:35 AM Jun Omae wrote: > > On Wed, May 18, 2022 at 9:20 AM Dan wrote: > > > > It looks like this issue is due to pygments.lexers.get_all_lexers() having > > multiple mime types associated with this extension. > > > > ('C', ('c',), ('*.c', '*.h', '*.idc', '*.x[bp]m'),

[Trac] Re: When viewing a source ".c" file, Trac 1.5.4 shows it as an image

2022-05-18 Thread Dan
Or ... Adding "text/x-csrc:c" to the "mime_map" configuration list also works, but it seems like a software-development-oriented system shouldn't need to special-case common software source files. - Dan On Tuesday, May 17, 2022 at 7:26:22 PM UTC-5 Dan wrote: > Works for me, I guess. At least

[Trac] Re: When viewing a source ".c" file, Trac 1.5.4 shows it as an image

2022-05-17 Thread Dan
Works for me, I guess. At least in this case. Index: api.py === --- api.py(revision 17579) +++ api.py(working copy) @@ -930,7 +930,8 @@ for mimetype, kwds in renderer.get_extra_mimetypes() or []:

[Trac] Re: When viewing a source ".c" file, Trac 1.5.4 shows it as an image

2022-05-17 Thread Dan
It looks like this issue is due to pygments.lexers.get_all_lexers() having multiple mime types associated with this extension. ('C', ('c',), ('*.c', '*.h', '*.idc', '*.x[bp]m'), ('text/x-chdr', 'text/x-csrc', 'image/x-xbitmap', 'image/x-xpixmap')) So, in mimeview.py, Mimeview.mime_map(), there

[Trac] Re: When viewing a source ".c" file, Trac 1.5.4 shows it as an image

2022-05-17 Thread Dan
FWIW, if I set the mime type to "text/x-csrc" it will highlight. Also, although the .h file is shown, I think it's not highlighted. I suppose if I set the mime type it would regain its mind. I'll have to look deeper, I guess. - Dan On Tuesday, May 17, 2022 at 3:42:31 PM UTC-5 Dan wrote: >