'Build an extension which registers fakeSerializer.'

def buildExtension(self):

    def fakeSerializer(elem):
        return u'<div><p>foo</p></div>'
    class registerFakeSerializer(markdown.extensions.Extension, ):
        def extendMarkdown(self, md, md_globals):
            md.output_formats[u'fake'] = fakeSerializer
    return registerFakeSerializer()
