From 9ed7df736d92d8cb261c13e84bfff9f59978c876 Mon Sep 17 00:00:00 2001 From: Smite Chow Date: Fri, 6 Nov 2015 12:00:08 +0800 Subject: [PATCH] :bug: fix get element style key error --- html2text/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html2text/utils.py b/html2text/utils.py index a2a2d8c..418c89c 100644 --- a/html2text/utils.py +++ b/html2text/utils.py @@ -80,7 +80,7 @@ def element_style(attrs, style_def, parent_style): style = parent_style.copy() if 'class' in attrs: for css_class in attrs['class'].split(): - css_style = style_def['.' + css_class] + css_style = style_def.get('.' + css_class, {}) style.update(css_style) if 'style' in attrs: immediate_style = dumb_property_dict(attrs['style'])