Skip to content
Permalink
Browse files

Use compile_string API for any compiler

  • Loading branch information
Kwpolska committed Jan 8, 2017
1 parent 2e28da4 commit 46747615bd5c4f392c25ebb053b3598ca32c37f4
Showing with 7 additions and 7 deletions.
  1. +7 −7 v7/static_comments/static_comments.py
@@ -86,18 +86,18 @@ def _compile_content(self, compiler_name, content, filename):
if compiler_name == 'rest':
content, error_level, _ = compiler.compile_string(content)
if error_level >= 3:
_LOGGER.error("Restructured text page compiler ({0}) failed to compile comment {1}!".format(compiler_name, filename))
_LOGGER.error("reStructuredText page compiler ({0}) failed to compile comment {1}!".format(compiler_name, filename))
exit(1)
return content
elif compiler_name == 'markdown':
content, deps = compiler.compile_string(content)
return content
else:
try:
return compiler.compile_to_string(content) # This is a non-standard function! May not be available with any page compiler!
return compiler.compile_string(content)[0]
except AttributeError:
_LOGGER.error("Page compiler plugin '{0}' provides no compile_to_string function (comment {1})!".format(compiler_name, filename))
exit(1)
try:
return compiler.compile_to_string(content)
except AttributeError:
_LOGGER.error("Page compiler plugin '{0}' provides no compile_to_string function (comment {1})!".format(compiler_name, filename))
exit(1)

def _read_comment(self, filename, owner, id):
"""Read a comment from a file."""

0 comments on commit 4674761

Please sign in to comment.
You can’t perform that action at this time.