def test_highlighting(self): # You can pass any lexer to the pygmentize function and it will # never fail loudly. from libpaste.highlight import pygmentize pygmentize('code', lexer_name='python') pygmentize('code', lexer_name='doesnotexist')
def highlight(snippet): h = pygmentize(snippet.content, snippet.lexer) h = h.replace(" ", " ") h = h.replace("\t", " ") return h.splitlines()