= Description =
Well that may be is more a feature but also it could be named problem or limitation.

Currently the highlight parser has precedence for parsing of any attachment before other parsers. If it is possible to highlight a mimetype it is hightlighted and not parsed by an other parser.


== Example ==
if it can highlight rst markup it highlights it instead of rendering it 

{{attachment:test.rst}}

On my box it looks like:

{{attachment:example.png}}

== Component selection ==

## Where you think is this bug happening ? (general, plugin [plugin name], theme [theme name], ...

 * general

== Details ==

## If you got a traceback, please save the traceback page as html and attach here:
## [[attachment:traceback.html]]

## if the bug is in this wiki, just kill the table and write: This Wiki.

## If a traceback is not available, please fill in the details here:
|| '''!MoinMoin Version''' || 1.9  ||
|| '''OS and Version''' ||  ||
|| '''Python Version''' ||  ||
|| '''Server Setup''' || ||
|| '''Server Details''' || ||
|| '''Language you are using the wiki in''' (set in the browser/UserPreferences) || ||

== Workaround ==
## How to deal with the bug until it is fixed


= Discussion =
May be we should use a param for highlighting and try on default to call a specific parser if present. If there is no parser found it does fallback on highlighting. At the moment when pygments introduces the mimetype you have parsed on your own before then your files become highlighted. For some of these files it is also interesting to show the source highlighted. Currently we can't choose what we want.

On this wiki for example now every traceback.html attached to a bugreport is highlighted instead of rendered.


A simple 1.8 compatible solution is to add to each old highlight parser only the extenstions used by pygments lexer for this parser and to add all highlighting patterns to MIMETYPES_MORE. Also we have to force that the highlight parser is the first entry in parser_plugins.

{{attachment:compatibility.patch}}


= Plan =
## This part is for Moin``Moin developers:

 * Priority: 
 * Assigned to:
 * Status:
  * fixed by http://hg.moinmo.in/moin/1.9/rev/b7ab238032dd (based on the patch shown above), please test
  * extensions for rst parser: http://hg.moinmo.in/moin/1.9/rev/0c424b6dc029
  * shall we define extensions for creole / moin wiki?
    . I wanted to use moin attachments in the past and I remember at least one other on #moin asking for that. 

----
## If you are a moin core developer, replace the category to Category* in these cases:
## Category MoinMoinNoBug - if this is not a bug.
## Category MoinMoinBugConfirmed - if you can confirm the bug on current code.
## Category MoinMoinBugFixed - after the bug is fixed in current code.
CategoryMoinMoinBugFixed