markup.py 文件源码

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

项目:ome-model 作者: ome 项目源码 文件源码
def _interpolate_attrs(self, stream):
        for kind, data, pos in stream:

            if kind is START:
                # Record any directive attributes in start tags
                tag, attrs = data
                new_attrs = []
                for name, value in attrs:
                    if value:
                        value = list(interpolate(value, self.filepath, pos[1],
                                                 pos[2], lookup=self.lookup))
                        if len(value) == 1 and value[0][0] is TEXT:
                            value = value[0][1]
                    new_attrs.append((name, value))
                data = tag, Attrs(new_attrs)

            yield kind, data, pos
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号