From 2e8cc7f5032a731bda72bff05b6de0482940dd0f Mon Sep 17 00:00:00 2001 From: Michael Carlberg Date: Wed, 17 May 2017 23:11:59 +0200 Subject: [PATCH] fix(parser): Ignore sequential duplicates in color stacks --- src/components/parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/parser.cpp b/src/components/parser.cpp index 83c50500..423127d4 100644 --- a/src/components/parser.cpp +++ b/src/components/parser.cpp @@ -192,7 +192,7 @@ unsigned int parser::parse_color(std::stack& color_stack, string& color_stack.pop(); } auto parsed_value = parse_color_string(value, !color_stack.empty() ? color_stack.top() : fallback); - if (!value.empty() && value[0] != '-') { + if (!value.empty() && value[0] != '-' && (color_stack.empty() || (parsed_value != color_stack.top()))) { color_stack.push(parsed_value); } return parsed_value;