From 2c57c1014ae8e44e62021ea2cc36c54352389632 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Mon, 14 Mar 2016 20:46:13 +0000 Subject: Implement collapsing using HTML AST --- mammoth/images.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'mammoth/images.py') diff --git a/mammoth/images.py b/mammoth/images.py index 713f739..3def424 100644 --- a/mammoth/images.py +++ b/mammoth/images.py @@ -1,9 +1,12 @@ +from . import html + + def inline(func): - def convert_image(image, html_generator): + def convert_image(image): attributes = func(image).copy() if image.alt_text: attributes["alt"] = image.alt_text - html_generator.self_closing("img", attributes) + return [html.self_closing_element("img", attributes)] return convert_image -- cgit v1.2.3