writer.py 文件源码

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

项目:pymotw3 作者: reingart 项目源码 文件源码
def visit_paragraph(self, node):
        index = node.parent.index(node)
        if (index > 0 and isinstance(node.parent, nodes.compound) and
                not isinstance(node.parent[index - 1], nodes.paragraph) and
                not isinstance(node.parent[index - 1], nodes.compound)):
            # insert blank line, if the paragraph follows a non-paragraph node in a compound
            self.body.append('\\noindent\n')
        elif index == 0 and isinstance(node.parent, nodes.footnote):
            # don't insert blank line, if the paragraph is first child of a footnote
            pass
        else:
            self.body.append('\n')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号