diff options
Diffstat (limited to 'sphinx/highlighting.py')
-rw-r--r-- | sphinx/highlighting.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py index ba5091735..a70d8e1e0 100644 --- a/sphinx/highlighting.py +++ b/sphinx/highlighting.py @@ -87,10 +87,11 @@ class PygmentsBridge(object): return if stylename == 'sphinx': style = SphinxStyle - elif isinstance(stylename, basestring): - style = get_style_by_name(stylename) + elif '.' in stylename: + module, stylename = stylename.rsplit('.', 1) + style = getattr(__import__(module, None, None, ['']), stylename) else: - style = stylename + style = get_style_by_name(stylename) self.hfmter = {False: HtmlFormatter(style=style), True: HtmlFormatter(style=style, linenos=True)} self.lfmter = {False: LatexFormatter(style=style), |