'Converts a filename into a syntax for the syntax highlighter, with
some modifications for specific common mozilla files.
The list of syntaxes is from:
http://alexgorbatchev.com/SyntaxHighlighter/manual/brushes/'

def get_syntax(self, filename):

    if filename:
        short = os.path.splitext(filename)[1][1:]
        syntax_map = {'xul': 'xml', 'rdf': 'xml', 'jsm': 'js', 'json': 'js', 'webapp': 'js'}
        short = syntax_map.get(short, short)
        if (short in ['actionscript3', 'as3', 'bash', 'shell', 'cpp', 'c', 'c#', 'c-sharp', 'csharp', 'css', 'diff', 'html', 'java', 'javascript', 'js', 'jscript', 'patch', 'pas', 'php', 'plain', 'py', 'python', 'sass', 'scss', 'text', 'sql', 'vb', 'vbnet', 'xml', 'xhtml', 'xslt']):
            return short
    return 'plain'
