#11296 closed enhancement (fixed)
"application/x-dos-batch" is an unknown mimetype when Pygments is not installed
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | low | Milestone: | 1.0.2 |
Component: | rendering | Version: | 1.0-stable |
Severity: | normal | Keywords: | mimetype wikiprocessor syntaxcoloring |
Cc: | Branch: | ||
Release Notes: |
Added shortnames |
||
API Changes: | |||
Internal Changes: |
Description
The WikiProcessor #!application/x-dos-batch
is used on the TracRepositoryAdmin page. In an installation without Pygments, the following error will be seen:
I propose the following patch to fix the issue, followed by replacement of #!application/x-dos-batch
with #!dos
on the TracRepositoryAdmin page.
-
trac/mimeview/api.py
diff --git a/trac/mimeview/api.py b/trac/mimeview/api.py index 2e3ca1d..aaaa550 100644
a b KNOWN_MIME_TYPES = { 290 290 'application/pdf': 'pdf', 291 291 'application/postscript': 'ps', 292 292 'application/rtf': 'rtf', 293 'application/x-dos-batch': 'dos batch cmd', 293 294 'application/x-sh': 'sh', 294 295 'application/x-csh': 'csh', 295 296 'application/x-troff': 'nroff roff troff',
Attachments (1)
Change History (4)
by , 11 years ago
Attachment: | WikiSyntaxError.png added |
---|
comment:2 by , 11 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Committed to 1.0-stable in [12041:12042]. Merged to trunk in [12043:12044].
The TracRepositoryAdmin page was updated in revision 32. It had been edited to use the application/x-dos-batch
in revision 9. I didn't find any other uses of #!application/x-dos-batch
in the documentation.
comment:3 by , 11 years ago
The 100%
sized image in comment:description makes for quite a view below TracQuery#Customizingthetableformat!
Pygment's BatchLexer defines the shortname
bat
for mimetypeapplication/x-dos-batch
in the latest release of Pygments, which is 1.6.dosbatch
andwinbatch
have since been added to the mainline (changes made in 414d4a1e and pulled in c3493668).It seems like
dos
,batch
andcmd
are all reasonable guesses at a shortname for the mimetype, and they aren't used elsewhere in Trac WikiProcessors or Pygments, so I'll addbat batch cmd dos
as short names for the mimetypeapplication/x-dos-batch
.