mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-11-23 11:56:36 +11:00
Do not dump rst errors in the logfile.
This commit is contained in:
parent
0fc6801213
commit
c77548332f
1 changed files with 5 additions and 2 deletions
|
@ -87,6 +87,8 @@ class RestructuredTextHighlighter(PlainTextHighlighter):
|
|||
'settings_overrides': {
|
||||
'raw_enabled': False,
|
||||
'file_insertion_enabled': False,
|
||||
'report_level': 3,
|
||||
'warning_stream': '/dev/null',
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,6 +98,7 @@ class RestructuredTextHighlighter(PlainTextHighlighter):
|
|||
parts = publish_parts(**self.publish_args)
|
||||
return mark_safe(parts[self.rst_part_name])
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
@ -112,7 +115,7 @@ class PygmentsHighlighter(Highlighter):
|
|||
Highlight code string with Pygments. The lexer is automaticially
|
||||
determined by the lexer name.
|
||||
"""
|
||||
formatter = NakedHtmlFormatter
|
||||
formatter = NakedHtmlFormatter()
|
||||
lexer = None
|
||||
lexer_fallback = PythonLexer()
|
||||
|
||||
|
@ -124,7 +127,7 @@ class PygmentsHighlighter(Highlighter):
|
|||
logger.warning('Lexer for given name %s not found', lexer_name)
|
||||
self.lexer = self.lexer_fallback
|
||||
|
||||
return highlight(code_string, self.lexer, self.formatter())
|
||||
return highlight(code_string, self.lexer, self.formatter)
|
||||
|
||||
|
||||
class SolidityHighlighter(PygmentsHighlighter):
|
||||
|
|
Loading…
Reference in a new issue