# Path: brigitte/utils/highlight.py
# def pygmentize(mime, blob):
#     try:
#         lexer = lexers.get_lexer_for_mimetype(mime)
#     except ClassNotFound:
#         try:
#             lexer = lexers.get_lexer_by_name(mime)
#         except:
#             lexer = lexers.get_lexer_by_name('text')
# 
#     pygmented_string = pygments.highlight(blob, lexer, NakedHtmlFormatter())
#     pygmented_string = unescape_amp(pygmented_string)
# 
#     return mark_safe(pygmented_string)


from django import template
from brigitte.utils.highlight import pygmentize
# -*- coding: utf-8 -*-



register = template.Library()


@register.filter
def pygmentize_diff(blob):
    try:

# Path: brigitte/utils/highlight.py
# def pygmentize(mime, blob):
#     try:
#         lexer = lexers.get_lexer_for_mimetype(mime)
#     except ClassNotFound:
#         try:
#             lexer = lexers.get_lexer_by_name(mime)
#         except:
#             lexer = lexers.get_lexer_by_name('text')
# 
#     pygmented_string = pygments.highlight(blob, lexer, NakedHtmlFormatter())
#     pygmented_string = unescape_amp(pygmented_string)
# 
#     return mark_safe(pygmented_string)


# Path: brigitte/utils/templatetags/utils_tags.py
from django import template
from brigitte.utils.highlight import pygmentize

# -*- coding: utf-8 -*-



register = template.Library()


@register.filter
def pygmentize_diff(blob):
    try:

        return pygmentize('diff', blob)