Commits

Kirill Simonov  committed 57528e1

Updated sphinxcontrib.htsqldoc to be compatible with the latest version of Sphinx.

  • Participants
  • Parent commits 67e0862

Comments (0)

Files changed (1)

File src/sphinxcontrib/htsqldoc/__init__.py

     lang = self.highlightlang
     linenos = node.rawsource.count('\n') >= \
               self.highlightlinenothreshold - 1
+    highlight_args = node.get('highlight_args', {})
     if node.has_key('language'):
         lang = node['language']
+        highlight_args['force'] = True
     if node.has_key('linenos'):
         linenos = node['linenos']
     def warner(msg):
         self.builder.warn(msg, (self.builder.current_docname, node.line))
-    self.highlighter.fmter[False].nowrap = True
-    self.highlighter.fmter[True].nowrap = True
+    self.highlighter.formatter.nowrap = True
     highlighted = self.highlighter.highlight_block(
-        node.rawsource, lang, linenos, warn=warner)
-    self.highlighter.fmter[False].nowrap = False
-    self.highlighter.fmter[True].nowrap = False
+        node.rawsource, lang, warn=warner, linenos=linenos,
+        **highlight_args)
     if highlighted.startswith('<pre>') and highlighted.endswith('</pre>\n'):
         # may happen if the language is not detected correctly
         highlighted = highlighted[5:-7]