From 3d81ce6e34e6216b4ec67deee50aab60097a52b0 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 5 May 2015 17:58:33 +0200 Subject: epub: Ignore syntax errors in HTML tag style attributes. --- source/html/css-apply.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'source/html') diff --git a/source/html/css-apply.c b/source/html/css-apply.c index d78d82ee..fbccac8d 100644 --- a/source/html/css-apply.c +++ b/source/html/css-apply.c @@ -603,16 +603,23 @@ fz_match_css(fz_context *ctx, fz_css_match *match, fz_css_rule *css, fz_xml *nod s = fz_xml_att(node, "style"); if (s) { - head = tail = prop = fz_parse_css_properties(ctx, s); - while (prop) + fz_try(ctx) { - add_property(match, prop->name, prop->value, INLINE_SPECIFICITY); - tail = prop; - prop = prop->next; + head = tail = prop = fz_parse_css_properties(ctx, s); + while (prop) + { + add_property(match, prop->name, prop->value, INLINE_SPECIFICITY); + tail = prop; + prop = prop->next; + } + if (tail) + tail->next = css->garbage; + css->garbage = head; + } + fz_catch(ctx) + { + fz_warn(ctx, "ignoring style attribute"); } - if (tail) - tail->next = css->garbage; - css->garbage = head; } } -- cgit v1.2.3