+EpubFormat.renderers.register(core.Div, 'p', NaturalText('p'))
+
+EpubFormat.renderers.register(core.Div, 'list', NaturalText('ul'))
+EpubFormat.renderers.register(core.Div, 'list.enum', NaturalText('ol'))
+EpubFormat.renderers.register(core.Div, 'item', NaturalText('li'))
+
+
+class DivImageR(EpubRenderer):
+ def render(self, element, ctx):
+ src = element.attrib.get('src', '')
+ ctx.images.append(src)
+ src = src.rsplit('/', 1)[1]
+ return super(DivImageR, self).render(element, Context(ctx, src=src))
+
+ def container(self, ctx):
+ root, inner = super(DivImageR, self).container(ctx)
+ src = getattr(ctx, 'src', '')
+ inner.set('src', src)
+ # inner.set('style', 'display: block; width: 60%; margin: 3em auto')
+ return root, inner
+EpubFormat.renderers.register(core.Div, 'img', DivImageR('img'))