view MoinMoin/parser/ @ 5400:b7ab238032dd

fix/simplify HighlightParser and compatibility wrappers (details see below) building of extensions list: don't use regex if .startswith is enough for compat wrappers, use empty extensions list, because we have all those extensions declared in the HighlightParser itself, so moin will call that directly, without using the wrapper. make sure that the mimetypes support knows all mimetypes/filename extensions known to pygments. when building the extensions -> parser mapping, first process the highlight parser, so that later in processing, other ("better") parsers can overwrite the mapping entry for some extension they support. this fixes that moin did syntax highlighting for .html attachments although it has a safe html parser that could safely render the .html file. usually we want to prefer rendering before highlighting. Thanks for Reimar Bauer for the patch.
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Wed, 06 Jan 2010 04:10:21 +0100
parents 20747ef82aca
line wrap: on
line source
# -*- coding: iso-8859-1 -*-
    MoinMoin - Java Source Parser

    DEPRECATED compatibility wrapper calling the highlight parser.

    This is to support (deprecated) existing syntax like:
    {{{#!java ...

    It is equivalent to the new way to highlight code:
    {{{#!highlight java ...

    @copyright: 2008 MoinMoin:ThomasWaldmann
    @license: GNU GPL, see COPYING for details.

from MoinMoin.parser.highlight import Parser as HighlightParser
from MoinMoin.parser.highlight import Dependencies

class Parser(HighlightParser):
    parsername = 'java'  # Lexer name pygments recognizes
    extensions = [] # this is only a compatibility wrapper, we have declared
                    # support for this extension in the HighlightParser, so
                    # moin will call that directly