def mk_html(self):
"""Simply calls configured html template filters
See settings.CAMPAIGNS['HTML_TEMPLATE_FILTERS']
"""
# Doctype gets frequently removed by content filters, so we save
# it...
doc = lxml.etree.HTML(self.html)
doctype = ''
if doc is not None:
doctype = doc.getroottree().docinfo.doctype
# ... we process content...
mangled_content = post_template_html_generation.process(
self.html,
detach_images=self.detach_images,
organization=self.author.organization)
# And we re-inject it
return '{}\n{}'.format(doctype, mangled_content)
评论列表
文章目录