:+1: although I would add another if IPython conditional, that way if a language is set via the function parameter OR cell magic, the `get_lexer_by_name(language, stripall=True)` call only has to be in one place.

```python
if language == 'ipython':
    magic_language = which_magic_language(source)
    if magic_language:
        language = magic_language

if language == 'ipython':
    lexer = IPythonLexer()
else:
    lexer = get_lexer_by_name(language, stripall=True)
 
return pygements_highlight(source, lexer, output_formatter) 
```