models.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:munch-core 作者: crunchmail 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号