Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Allowing to pass through HTML.
  • Loading branch information
felixfontein committed Jan 8, 2017
1 parent 95ebbb5 commit c58e2a2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion v7/static_comments/README.md
Expand Up @@ -31,7 +31,9 @@ Comment files are of the following form::

the content spans the rest of the file.

Most header fields are optional. `compiler` must specify a page compiler which allows to compile a content given as a string to a string; these are currently the restructured text compiler (`rest`), the `ipynb` compiler, and the [WordPress](https://plugins.getnikola.com/#wordpress_compiler) (`wordpress`) compiler. Comments can form a hierarchy; `parent_id` must be the comment ID of the parent comment, or left away if there's no parent.
Most header fields are optional. `compiler` must specify a page compiler which allows to compile a content given as a string to a string; these are currently the restructured text compiler (`rest`), the `ipynb` compiler, and the [WordPress](https://plugins.getnikola.com/#wordpress_compiler) (`wordpress`) compiler. You can also specify `html`, in which case the comment's content will be taken as HTML without any processing.

Comments can form a hierarchy; `parent_id` must be the comment ID of the parent comment, or left away if there's no parent.


Inclusion in theme
Expand Down
3 changes: 3 additions & 0 deletions v7/static_comments/static_comments.py
Expand Up @@ -76,6 +76,9 @@ class StaticComments(SignalHandler):

def _compile_content(self, compiler_name, content, filename):
"""Compile comment content with specified page compiler."""
if compiler_name == 'html':
# Special case: just pass-through content.
return content
if compiler_name not in self.site.compilers:
_LOGGER.error("Cannot find page compiler '{0}' for comment {1}!".format(compiler_name, filename))
exit(1)
Expand Down

0 comments on commit c58e2a2

Please sign in to comment.