From 6cab76d8148fee8e3387b40733f5793eeb48b21f 2014-04-30 17:35:27 From: MinRK Date: 2014-04-30 17:35:27 Subject: [PATCH] keep .highlight css class highlight area now gets two classes: 'div.highlight.hl-language' CSS header is generated for class '.highlight', but cells were given class '.hl-language', so the CSS wasn't applying correctly. --- diff --git a/IPython/nbconvert/filters/highlight.py b/IPython/nbconvert/filters/highlight.py index d52274e..61cb654 100644 --- a/IPython/nbconvert/filters/highlight.py +++ b/IPython/nbconvert/filters/highlight.py @@ -2,41 +2,23 @@ Module containing filter functions that allow code to be highlighted from within Jinja templates. """ -#----------------------------------------------------------------------------- -# Copyright (c) the IPython Development Team. -# -# Distributed under the terms of the Modified BSD License. -# -# The full license is in the file COPYING.txt, distributed with this software. -#----------------------------------------------------------------------------- -#----------------------------------------------------------------------------- -# Imports -#----------------------------------------------------------------------------- +# Copyright (c) IPython Development Team. +# Distributed under the terms of the Modified BSD License. # pygments must not be imported at the module level # because errors should be raised at runtime if it's actually needed, # not import time, when it may not be needed. -# Our own imports from IPython.nbconvert.utils.base import NbConvertBase -#----------------------------------------------------------------------------- -# Globals and constants -#----------------------------------------------------------------------------- - MULTILINE_OUTPUTS = ['text', 'html', 'svg', 'latex', 'javascript', 'json'] -#----------------------------------------------------------------------------- -# Utility functions -#----------------------------------------------------------------------------- - __all__ = [ 'Highlight2HTML', 'Highlight2Latex' ] - class Highlight2HTML(NbConvertBase): def __call__(self, source, language=None, metadata=None): @@ -58,7 +40,7 @@ class Highlight2HTML(NbConvertBase): return _pygments_highlight(source if len(source) > 0 else ' ', # needed to help post processors: - HtmlFormatter(cssclass="hl-"+language), + HtmlFormatter(cssclass=" highlight hl-"+language), language, metadata)