From 0a42da0f8f7ede20802adaea5c6929e020ab6286 2015-01-20 17:04:36 From: Thomas Kluyver Date: 2015-01-20 17:04:36 Subject: [PATCH] Merge pull request #7504 from abalkin/magic-lang Fixes #7503 - Cell magics fail to switch the language --- diff --git a/IPython/nbconvert/filters/highlight.py b/IPython/nbconvert/filters/highlight.py index 59c0df1..336ad82 100644 --- a/IPython/nbconvert/filters/highlight.py +++ b/IPython/nbconvert/filters/highlight.py @@ -113,7 +113,7 @@ def _pygments_highlight(source, output_formatter, language='ipython', metadata=N # If the cell uses a magic extension language, # use the magic language instead. - if language == 'ipython' \ + if language.startswith('ipython') \ and metadata \ and 'magics_language' in metadata: